Continuous Integration for Ruby on Rails
Ross Niemi ThoughtWorks, Inc. Email: rniemi@thoughtworks.com Blog: http://rossniemi.wordpress.com March 12th, 2007
Continuous Integration for Ruby on Rails Ross Niemi ThoughtWorks, - - PowerPoint PPT Presentation
Continuous Integration for Ruby on Rails Ross Niemi ThoughtWorks, Inc. Email: rniemi@thoughtworks.com Blog: http://rossniemi.wordpress.com March 12th, 2007 Agenda What is Continuous Integration (CI)? What CI tools are currently
Ross Niemi ThoughtWorks, Inc. Email: rniemi@thoughtworks.com Blog: http://rossniemi.wordpress.com March 12th, 2007
– IS NOT a tool or product – IT IS a practice or philosophy that a team has to buy into
“Continuous Integration is an Attitude, Not a Tool”
– Developer wanting to check in code into the repository must acquire the “token” – Only one person can check in at a time – The same person would then check out the code on a different machine and run the build in a clean environment – If the build “breaks”, the offender fixes it on their machine and tries the verification step again – Once the build passes, the “token” is returned so someone else could perform a check in – Very serial process, time consuming
want to increase the build frequency
– Detects a change in the code repository – Update its working copy – Runs the build and executes tests – Notifies interested parties of success or failure
# Add application directory to monitor cerberus add directory APPLICATION_NAME=application RECIPIENTS=email address, … # Add application SVN repository to monitor cerberus add subversion_url APPLICATION_NAME=application RECIPIENTS=email address, … # List of active projects cerberus list # Build a single or all applications cerberus build application cerberus buildall # Command line help cerberus --help
# Default home $CERBERUS_HOME=~/.cerberus # Server artifacts ~/.cerberus/config.yml ~/.cerberus/error.log # Project artifacts ~/.cerberus/config/application.yml ~/.cerberus/work/application /logs - timestamped build logs /Status.log - status of last build
cruise_dir/cruisecontrol.sh cruise_dir/cruisecontrol.bat
# Server / Project configuration cruise_dir/config.xml # Project artifacts - can override locations cruise_dir/project.ser cruise_dir/projects/project cruise_dir/logs/project cruise_dir/artifacts/project
– Bootstrappers are operations done before the build takes place, regardless if a build is necessary or not – ModificationSet is scheduled to poll to see if change in the code repository occurred – Schedule is a reoccurring event used to perform a build provided that there are modifications – Publishers distribute the results of a build – Log is used to report on the build execution
require 'rubygems' gem 'ci_reporter’ # use the following if using RSpec require 'ci/reporter/rake/rspec’ # use the following if using Test::Unit require 'ci/reporter/rake/test_unit’
# Start the web server ./cruise start [options ]
# Add application SVN repository to monitor ./cruise add your_project --url subversion-url [--username username --password password] # Build your_project ./cruise build your_project [--trace ] # Command line help ./cruise help [command ]
# Server artifacts cruise_dir/config/site_config.rb # Project artifacts cruise_dir/projects/your_project /work /build-rev /build.log /build_status.status /changeset.log /cruise_config.rb
Note: project.rake_task and project.build_command both cannot be set
– project.scheduler.polling_interval = 5.minutes
– project.scheduler = MyCustomScheduler.new(project)