Install CI Hudson for Ruby on Ubuntu
Posted by AllenWei | Posted in Agile | Posted on 15-02-2010-05-2008
View Comments
- We can easily kill or start a new build
- We can test all branches or some branches in a git repository. It’s
- It will send email to a mail list when test broke and send another email to someone who break the test.
- It has code coverage plugin.
Then how to install on ubuntu
Add Hudson source to ubuntu
Add These line to /etc/apt/sources.list
Install Hudson
sudo apt-get install hudson
Start is easy
Configuration
Now you can enter with
Install Hudson Plugin
Go to
These plugins you need to install
- Rake
- Ruby Plugin
- Ruby metrics plugin
- Git Plugin (optional)
Create a new Hudson Job
- Click
New Joblink - Enter your
Job name - Select
Build a free-style software project - Setup Git repository
- Enter Your URL of repository
- Branch Specifier, if you only want to test master you can type in
*/master, leave blank hudson will test all your branches
Ok, Save. We leave other configuration for now. we will back.
Click Build Now link at left. Hudson will clone your repository to it’s workspace.
If everything is ok, you can see your code in
Add ci required rails plugins
Before you add these plugins, you need:
- create a new branch
- Install ci_reporter plugin
- Install rails_rcov_engines plugin
*
*
Continue Configuration
Back to you job configuration, finish reset parts of configuration
- Click the button
Advanced.., above “Repository browser” - Enter
ci Build Triggers > Poll SCM*/10 * * * * , Poll git commit every 10 minsBuild > Add build step > Execute shell, then enter
export CI_REPORTS=results
export RAILS_ENV=test
export CI_REPORTS=results
export RAILS_ENV=test
# Prepare for rcov
[ -d "coverage" ] && rm -rf coverage
[ -d "results" ] && rm -rf results
mkdir coverage
mkdir results
# invoke rake
rake db:create db:migrate ci:setup:testunit test:test:rcov SHOW_ONLY=models,helpers,controllers RAILS_ENV=test RCOV_PARAMS="--aggregate coverage/aggregate.data"
Post-build Actions > Publish JUnit test result reportenterresults/*.xmlPost-build Actions > Publish Rcov report, entercoverage/testin Rcov report directoryPost-build Actions > E-mail Notification, config emails you want to send when test broke
Ok, you can click Build Now. After build you will see the test result code coverage.
> Test make perfect!


