user3564904
user3564904

Reputation: 33

jenkins (Publish with SSH Plugin)

I want to build my maven project in Jenkins and copy all the the jar files to a remote Unix machine. Also I want to connect to a LDAP data Store and start the services and test if the services are up and running

Basically I want to do the following tasks after my project is successfully build in Jenkins:-

1)Copy current version of my project to designated machine and location

2)Copy configure to connect to a designated integration test DS

3)Start the services in my project

4)Test that it is running.

Can I achieve this by Publish over SSH plugin provided in jenkins?? Or Shall I create some scripts which can automate the above tasks.The reason I am asking this is because I am not very familiar with Jenkins and Unix scripting.

Is there any good approach to do this task.

Thanks in advance.

Ansia

Upvotes: 1

Views: 1723

Answers (2)

Morfic
Morfic

Reputation: 15508

Yes, you can use the publish over ssh plugin to copy the jars, and execute a script which launches your services. Take a look here to see how to launch a script "in the background" so it does not get killed when the session ends or to avoid blocking the Jenkins build by making it wait for the script to finish executing

Can't say much about LDAP as I haven't used it but depending on your needs I guess you could create a basic helper-jar with spring-ldap or any other similar library.

Upvotes: 1

Slav
Slav

Reputation: 27485

The Publish over SSH plugin will allow you copy files to remote server and execute arbitrary commands on the remote server.

Question is - do you know how you would achieve the following on the remote server?

2)Copy configure to connect to a designated integration test DS
3)Start the services in my project
4)Test that it is running

If yes, just enter those commands into Publish over SSH configuration. Or provide a script to be executed.

If you don't know how to achieve that, then that's a separate question.

Upvotes: 1

Related Questions