Continuous Integration with Scratchbox And CruiseControl

1,298 views
1,244 views

Published on

Slides for a Lightning speech held on Maemo Summit 2009 on 10th of October.

Topic is about how to harness Cruisecontrol to full build / packaging / testing and repository update cycle for development teams big and small.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,298
On SlideShare
0
From Embeds
0
Number of Embeds
19
Actions
Shares
0
Downloads
15
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Continuous Integration with Scratchbox And CruiseControl

  1. 1. Continuous Integration w/ Scratchbox & CruiseControl Jani Mikkonen jani.mikkonen@symbio.com ext-jani.3.mikkonen@nokia.com
  2. 2. Overview • What is Continous Integration ? • Where to start ? • Setting up environment • Tie things up with CruiseControl • Contact details
  3. 3. What is Continuous Integration • Automated builds from SCM • Runs automated tests – Unit tests – Functional tests – Benchmarks – Code Coverage – API / ABI Breaks • Reporting • Artifacts handling
  4. 4. Where to start ? • Creating a debian package from your software is good start! • Each build phase should just have simple “make” target. • Gather the tools you need to produce all the build artifacts.
  5. 5. Setting up the environment • Maemo sdk and required rootstraps & build-tools • Some shell scripts to interact with scratchbox1 • Local SCM checkouts
  6. 6. Tie things up with CC Think off CI Tools as a fancy replacement for a cron.
  7. 7. Sample: sb-execute # Notice: most of the error handling stripped SBTARGET=$1 DIRECTORY=$2 COMMAND=$3 shift; shift; shift /scratchbox/login sb-conf se $SBTARGET || error 3 "Could not select target '$SBTARGET'." /scratchbox/login -d $DIRECTORY $COMMAND $@
  8. 8. Sample: project building <!-- update the build id in the changelog --> <exec timeout="2400" command="${homedir}/bin/updatebuildid" args="$ {sbhomedir}/rojects/${project.name} ${label}"/> <!-- install build dependencies --> <exec timeout="2400" command="${homedir}/bin/sb-install" args="$ {sbtargegt} ${build_dependencies}"/> <!-- runs: dpkg-buildpackage -b -rfakeroot on the given document --> <exec timeout="2400" command="${homedir}/bin/sb-buildpackage" args="$ {sbtargegt} /home/cruise/projects/${project.name}"/> <!-- run 'make' in given directory to run testsuite and translate the results to xml --> <exec timeout="2400" command="${homedir}/bin/sb-make" args="$ {sbtargegt} /home/cruise/projects/${project.name} check-xml"/> <!-- check if test results were all positive --> <exec timeout="2400" command="${homedir}/bin/testresults" args="$ {sbhomedir}/projects/${project.name}/tests"/>
  9. 9. Sample: project publishing <!-- remove build dependencies --> <execute command="${homedir}/bin/sb-remove ${sbtargegt} $ {build_dependencies}"/> <!-- email results to address list 'dev-mailinglist' --> <htmlemail buildresultsurl="http://localhost.localdomain" /> <propertiesmapper file="${homedir}/include/email.properties"/> </htmlemail> <!-- merge to master-stable on success --> <onsuccess> <execute command="${homedir}/bin/merge-master-stable $ {sbhomedir}/projects/${project.name}"/> </onsuccess>
  10. 10. Questions ? Contact ! Jani Mikkonen EMAIL: jani.mikkonen@symbio.com IRC: jani @ Freenode

×