-
-
Save edavis10/59194 to your computer and use it in GitHub Desktop.
Example of CruiseControl.rb cruise_config.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Example of CruiseControl.rb cruise_config.rb which dynamically picks #### | |
#### the version of Rails to use based on CCRB project name #### | |
# cruise_config.rb: | |
require 'fileutils' | |
Project.configure do |project| | |
project.email_notifier.emails = ["chad+sandbox-ci-#{Socket.gethostname.chomp.downcase}@mycompany.com"] | |
require "#{File.dirname(__FILE__)}/vendor/plugins/shared_stuff/lib/cruise/mycompany_cruise_config.rb" | |
MyCompany::CruiseConfig.config(project) | |
end | |
# mycompany_cruise_config.rb | |
module MyCompany | |
class CruiseConfig | |
def self.config(project) | |
ENV['CRUISE_PROJECT_NAME'] = project.name | |
if project.name =~ /rails[_-](.*)$/ # project_rails_1.2.5.7919 | |
rails_gem_version = $1 | |
rails_gem_version.gsub!('-','.') | |
ENV['RAILS_GEM_VERSION'] = rails_gem_version | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment