[Buildbot-devel] How to integrate multiple commands into one BuildStep?

Aaron_Hsieh at PlayStation.Sony.Com Aaron_Hsieh at PlayStation.Sony.Com
Fri Dec 7 00:02:50 UTC 2007


I actually had this exact same problem a couple months ago.  I actually 
got the answer to this on this forum, as a matter of fact.  If you use 
Python's triple quoting mechanism, you can actually fit multiple commands 
into one buildstep if you'd rather not use an external script.  So, 
instead of :

full_factory.addStep(step.ShellCommand, **basic_args(
command="for i in dist/*; do mv $i /var/www/packages; done && rake
clean && rm -rf /var/www/packages/foobar-current.tgz && cd
/var/www/packages && ln -s *.tar.gz foobar-current.tgz",
description="Publishing packages",
descriptionDone="Published packages"))


You could have:

full_factory.addStep(step.ShellCommand, **basic_args(
command="""for i in dist/*; do mv $i /var/www/packages; done
rake clean
rm -rf /var/www/packages/foobar-current.tgz
cd /var/www/packages
ln -s *.tar.gz foobar-current.tgz""",
description="Publishing packages",
descriptionDone="Published packages"))


The reason why you might want to put everything into a single buildstep is 
that you preserve the same shell for every command that you run and you do 
not have to keep up with random external scripts all over the place in 
case you would want to mirror this system on a different box.

Aaron Hsieh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20071206/a568fbdc/attachment.html>


More information about the devel mailing list