I have a development,stage and production branches in my trunk. My Stage servers don't have access to my Subversion files. Anytime code is merged into my Stage branch I want that code to be automatically deployed to my Stage servers. Is it possible for jenkins to poll get a list of just updated and added files and then have it run a batch file to copy to the new server. Im new to jenkins so any help on the proper way to do this and resources on writing the scripts would be very helpful.
1 Answers
Yes. Things you may find helpful are the Build Pipeline Plugin,
You may find the Copy Artifact plugin, Artifactory plugin useful as well.
I run mainly java jobs on a Linux based Jenkins server. We use maven or ant to build projects, then chain those jobs to deploy jobs that use capsitrano (ruby) to deploy to our dev/qa/sit/uat environments.
By batch file in your question I'll make the assumption you are running Jenkins on Windows. You can create build jobs that create artifacts, zip all those artifacts together and move them from job to job along a chain. This saves having to build on each job. (You like electricity bills low?) You will need to design your project so that configuration for each environment travels along from the build job (Copy Artifact) and the deploy job/code is environmentally aware. I love capistrano for this, but you can use batch/Powershell.
It seems the chain you want to create is Build and Deploy to Dev, with a tag build post-build action, then a Seperate job to poll for new tags and deploy as necessary. You can chain jobs or just poll SCM, but chaining jobs is easier. Jenkins job poling won't know that /project/tags/X-2013-10-12 exists, but will know project/tags/STAGE exists if its a static spot to poll.

- 2,254
- 18
- 24