Sha256: f6829d6b204e8c817ffbf1f81699c2f4812f055eb90629967782b481731196a7

Contents?: true

Size: 1.85 KB

Versions: 2

Compression:

Stored size: 1.85 KB

Contents

#!/usr/bin/env ruby

begin
  gem 'crazy_ivan'
rescue LoadError
  # If people are not using gems, the load path must still
  # be correct.
  # TODO: Remove the begin / rescue block somehow
  $:.unshift File.dirname(__FILE__) + '/../lib'
  retry
end

require 'crazy_ivan'
require "optparse"
require "logger"

Signal.trap("INT") { puts; exit }

def show_howto
  puts "Hankering for a continuous integration server, eh?"
  puts
  puts "1. Jump over to where you want to keep your projects"
  puts "   and git clone or svn checkout or whatever-them down:"
  puts "     $ mkdir -p /var/continuous-integration/projects/"
  puts "     $ cd /var/continuous-integration/projects"
  puts "     $ git clone git@github.com:edward/active_merchant.git"
  puts
  puts "2. Run:"
  puts "     $ crazy_ivan setup"
  puts
  puts "3. Run it manually to check that everything is ok:"
  puts "     $ crazy_ivan /var/www/ci"
  puts
  puts "   (/var/www/ci should be accessible through your web server)"
  puts "   Check /var/www/ci/index.html through a web browser."
  puts
  puts "4. Set up cron to run it every 15 minutes:"
  puts "     $ echo \"0,15,30,45 * * * * cd /var/continuous-integration; crazy_ivan /var/www/ci\" > ci.cron"
  puts "     $ crontab ci.cron"
  puts
  puts "5. Profit."
  puts
  puts "Please see http://github.com/edward/crazy_ivan for more."
end

options = {}

ARGV.options do |opts|
  opts.banner = "Usage:  #{File.basename($PROGRAM_NAME)} test_reports_path"
  
  opts.on_tail("-h", "--help", "Show this message") do
    show_howto
    puts opts
    exit
  end

  opts.on_tail("--version", "Show version") do
    puts CrazyIvan::VERSION
    exit
  end
  
  begin
    opts.parse!
    
    case ARGV[0]
    when /setup/
      CrazyIvan::setup
    when /\w+/  # a directory for test results
      CrazyIvan::generate_test_reports_in(ARGV[0])
    else
      show_howto
      exit
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
crazy_ivan-1.0.0 bin/crazy_ivan
crazy_ivan-0.3.3 bin/crazy_ivan