Separate Building from Deployment with Hudson
We have started using Hudson, and the current workflow is:
checkout locally > code > run tests > update > run tests > commit
Rather that polling, Hudson simply sits there until we instantiate a build. It then:
checkout locally > run Phing script
The Phing script then:
svn export latest revision > run tests (if successful) > generates reports etc.. > compresses export > scp to production server > .. do magic to make site live...
That all works fine and dandy, however it doesn't really give us the ability to any kind of of "staging" QA and every build builds the repo head revision. Ideally we would like Hudson to poll or use post commit hooks build each commit and:
checkout locally > run Phing task to run tests and if successful, generates reports etc..
Then be able to manually instantiate an automated deployment (via Phing task) to either "staging QA environment or production from with each specific build. Not every commit will be deployed to QA.
Is this work flow even possible from with Hudson, or are we going to need to manually run our deployment Phing tasks after.
I ended up doing something similar to Peter Schuetze suggestion. I used only the only job however. I use 3 build parameters, deploy (bool), environment (choice) and revision (text). I then altered my Phing scripts to only do deployments if the deploy parameter is true, in which case it will deploy the specified revision to the specified environment. By default deploy is false, revision is head and environment is staging. Now when Hudson polls svn, it sees the deploy parameter is false and bypasses the deployment tasks.
I'm not entirely clear on what you want to achieve, but I'm wondering whether you are using the Phing plugin? Perhaps what you want is not currently possible through Hudson and may require changing your development process to make it possible.
链接地址: http://www.djcxy.com/p/50730.html上一篇: Hudson + Maven + Emma / Sonar =构建循环运行2次
下一篇: 独立的建筑与Hudson的部署