Arya Asok
Arya Asok

Reputation: 1

Jenkins job to deploy a generated jar into a Unix SSH server

I am trying to create a Jenkins job that deploys my maven project jar into a Unix SSH server. I have created the jenkins job that will fetch the code from the git repository and do a maven install and created the jar file in my root workspace. Now I want that generated jar to be deployed in to a UNIX SSH server. Could any one please provide me some insights for the same. Thank you

Upvotes: 0

Views: 1966

Answers (4)

Upen
Upen

Reputation: 1438

You can scp the jar file to target location - https://wiki.jenkins.io/display/JENKINS/SCP+plugin

Upvotes: 0

Chandra Sekhar Y
Chandra Sekhar Y

Reputation: 550

You can Use Publish Over SSH Plugin to transfer your files in Workspace to remote SSH machine using this plugin.

Upvotes: 0

ANIL
ANIL

Reputation: 2682

Instead of running the job in the master, you can install a slave in the UNIX SSH Server and run your job on that particular slave where it will build the JAR file and then deploy it where ever you want in the UNIX server.

Upvotes: 1

Kraylog
Kraylog

Reputation: 7563

At the simplest level, you can run a shell command to copy the file to the remote server.

$ scp my-file user@remote-host:/some/dir

Alternatively, you can use tools like chef/ansible/puppet to automate different deployment tasks.

Upvotes: 0

Related Questions