sumanth veera (2015-10-04 16:35):
Hi All,
i am trying to Deploy the jar files to remote server from the
artifacts created.after the build process can any one tell me how to
do this .
Basically i need to deploy the jar to remote server.
If you have many servers (or plan to grow) it might be easier to setup
certificate authentication through SSH. This allows easier
parametrization and making easier to read scripts.
Basic steps are (assuming your Jenkins and remote server is Linux based):
1. Generate your local key (use a default options to generate
password-less authentication):
ssh-keygen -b 4096
2. Copy your key to remote server:
ssh-copy-id username@remote_host
3. Test login:
ssh username@remote_host
Note that from now on anyone having the certificate will be able to
connect to your remote host. So some extra security measures might be
required (e.g. enabling drive encryption).
So to copy a file you just execute shell script:
connectionString=username@remote_host
scp /some/local/file.jar $connectionString:/some/remote/file.jar
You can also run scripts:
scp /some/local/file.sh $connectionString:/some/remote/file.sh
ssh $connectionString /some/remote/file.sh
Or copy whole folder to remote:
scp -r /some/local/dir/ $connectionString:/some/remote/dir
Or you can copy remote folder to your jenkins:
scp -r $connectionString:/some/remote/dir /some/local/dir/
Regards,
Nux.
--
You received this message because you are subscribed to the Google Groups "Jenkins
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/56165633.6010500%40mol.com.pl.
For more options, visit https://groups.google.com/d/optout.