Question

I'm sure there are answers for this all over stackoverflow but I was unable to find anything specific.

I have a PHP project which I am revisiting. Its running on a RHEL5 box. I have SVN on the same box.

Out of curiosity I recently added Jenkins to the machine and have the jenkins php template at...

http://jenkins-php.org/

There was a bit of playing around with the setup but I more or less have this all running and doing Continuous Inspection builds when something is committed to SVN.

What I want to do now is have Jenkins copy my updated files across to the server when the build completes.

I am running a simple LAMP setup and would ideally only like to copy across the files that have actually changed.

Should I just use ANT & sync? Currently the files reside on the same box as the server but this may change whereby I will need to sync these files across to multiple remote boxes.

Thanks

Was it helpful?

Solution

Check these - Copy Artifact Plugin and the job's env variables. Now set 2 jobs - 1 on source machine and 1 on destination server (make it a slave). Use the plugin to copy required artifacts by using environment variables.

OTHER TIPS

Do you have your project (not the jenkins but that with LAMP setup) under the SVN? If yes I'd recommend to create standalone job in Jenkins that will just do an svn up and you could tie it to jenkins job the way like - you running your main job, and if build is ok jenkins automatically runs job to update your project.

For copying to other servers take a look at Publish Over plugins

It's very easy to setup server and rules. The bad thing is that you can't setup copying only the new files for current build which means that the entire project is uploaded every build.

If your project is too big, another solution is to use rsync as post build action.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top