分开构建与部署与Hudson [英] Separate Building from Deployment with Hudson

查看:194
本文介绍了分开构建与部署与Hudson的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已开始使用Hudson,目前的工作流程是:



本地检出>代码>运行测试>更新>运行测试>提交



而是轮询,哈德森只是坐在那里,直到我们实例化一个构建。然后:



在本地签出>运行Phing脚本



Phing脚本然后:



svn导出最新版本>运行测试(如果成功)>生成报告等..> compresses export> scp到生产服务器> ..魔法让网站生活...



这一切都工作正常和dandy,但它并不真正给我们任何种类的分段QA的能力,每一个构建建立repo头修订。理想情况下,我们希望Hudson轮询或使用post提交钩子构建每个提交和:



本地检查>运行Phing任务运行测试,如果成功,生成报告等。



然后,可以手动实例化一个自动化部署(通过Phing任务)为从每个特定构建分阶段进行QA环境或生产。并非每个提交都将部署到QA。



这是Hudson的工作流程,或者我们需要手动运行我们的部署Phing任务。

解决方案

我最后做的事情类似于Peter Schuetze的建议,我只使用唯一的工作,但是我使用3个构建参数,部署)和revision(文本),然后我改变了我的Phing脚本,只有在部署参数为true的情况下执行部署,在这种情况下它将部署指定的修订版本到指定的环境。分期。现在,当Hudson轮询svn时,它会看到deploy参数为false,并绕过部署任务。


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.

这篇关于分开构建与部署与Hudson的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆