Pregunta

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?

Please provide if any sample deploy scripts

¿Fue útil?

Solución

I wrote my own deployment framework, consisting of different shell, batch, python, and .... scripts. It neatly separates environment information from application information and allows me to quickly update deployment information and add new apps or environment. However, the orchestration of the different parts is done by Jenkins. When just copying files to a Windows server, my Jenkins master (running on Windows) just copies the files to a network share that exposes the target directory. Services I can restart remotly using sc.exe. When crossing the borders to AIX, I use jenkins slaves that are started via ssh on the target system. So distribution is managed by Jenkins. The actual work is done by the scripts.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top