continuous interjection
Ruby Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.rvmrc
LICENSE.txt
README.rdoc
TODO.txt
ci.html
ci.rb
ci_ruby.rb
ci_runner.sh
ruote_ci.rb
ruote_ci.rb.bak

README.rdoc

ci

continuous interjection

Nothing special here, just a tiny CI tool, for my personal use (for ruote mainly).

usage

I have

# /etc/cron.d/ruote_ci

00 18 * * * jmettraux cd ~/ci && ./ci_runner.sh ruote_ci.rb > ~/ci/lastrun.txt 2>&1

ci_runner.sh makes sure RVM is available

#!/bin/bash
source $HOME/.rvm/scripts/rvm
cd . && ruby $*

the ci tasks (ruote_ci.rb) look like

require 'ci'

Ci::all do

  sh 'uname -a'
  sh 'rvm -v'

  reporter :stdout

  reporter :mail, :to => 'jmettraux@gmail.com'

  reporter(
    :s3,
    :bucket => 'ruote-ci',
    :access_key_id => arg('aki'), # --aki xxx
    :secret_access_key => arg('sak')) # --sak yyy
end

Ci::bundle 'ruote' do

  source 'http://rubygems.org'
  gem 'builder'
  gem 'mailtrap'
  gem 'yajl-ruby', :require => 'yajl'
  gem 'json_pure', '1.4.6'
  gem 'ruote', :git => 'http://github.com/jmettraux/ruote.git', :branch => 'ruote2.1'
end

Ci::task 'ruote on 1.8.7-p249' do

  #options :rvm => '1.8.7-p249'
  rvm :use => '1.8.7-p249'

  bundle 'ruote'

  ruby 'ruote/test/unit/test.rb'
  ruby 'ruote/test/unit/storage.rb'
  ruby 'ruote/test/functional/test.rb'
end

Ci::task 'ruote --fs on 1.9.2-p136' do

  rvm :use => '1.9.2-p136'

  bundle 'ruote'

  ruby 'ruote/test/unit/test.rb', '--', '--fs'
  ruby 'ruote/test/unit/storage.rb', '--', '--fs'
  ruby 'ruote/test/functional/test.rb', '--', '--fs'
end

It sends me 1 email per Ci::task. Those emails look like

Date: Fri, 14 May 2010 11:07:46 +0900
To: jmettraux@gmail.com
Subject: [ok] ruote 1.8.7 20100514_1107
From: ruote ci<ci@bakemono.example.com>

rm -fR ruote

git clone --quiet http://github.com/jmettraux/ruote.git

cd ruote && ~/.rvm/bin/rvm 1.8.7@ruote_yajl ruby test/unit/test.rb
<i>ruby-1.8.7-p249: ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-linux]  </i>
ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-linux]
Fri May 14 11:06:13 +0900 2010
Loaded suite test/unit/test
Started
.................................................................................
Finished in 0.129712 seconds.

81 tests, 165 assertions, 0 failures, 0 errors

cd ruote && ~/.rvm/bin/rvm 1.8.7@ruote_yajl ruby test/unit/storage.rb
<i>ruby-1.8.7-p249: ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-linux]  </i>
ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-linux]
Fri May 14 11:06:14 +0900 2010
Loaded suite test/unit/storage
Started
...............
Finished in 0.013415 seconds.

15 tests, 28 assertions, 0 failures, 0 errors

Task took 104.548031 seconds.

credits

Many thanks to the RVM authors and contributors.

license

although I'm the only user, the license is MIT.