This is a web project written in Java.
So, I'm writing the build and the deploy scripts. To create the build, I used ant. The continuous build is done with Jenkins.
The build generates 3 different artifacts:
- The war file
- A zip with layouts
- A zip with images
So far, so good, but now I need to write the deploy script, which should:
- Deploy the war (artifact 1) to the tomcat running at server 1
- Place the artifact 2 at server 1 in a specific directory
- Place the artifact 3 at server 2 in a specific directory
So I was talking with my colleague and he said that we should also generate an artifact (maybe deploy.xml) that deploys these artifacts when placed at the correct server.
So there would be another script, that would:
- Download the jenkins artifacts
- scp to each server and place the deploy.xml there
- remotely invoke the deploy.xml
What makes me a little uncomfortable is the act of having the deploy.xml as a build artifact. The motivation behind this would be to be able to make a deploy without needing to have access to the VCS repositories, so a build would be self-contained, ie, any build could go into production only with what was generated by Jenkins.
Where should the deploy scripts be placed? Should they be only at the VCS or should they be build artifacts too?