From d1a149f9f65bb151c5f98300071ee367d6992a90 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Wed, 29 Jun 2011 11:52:13 -0700 Subject: [PATCH] Some stuff to not need an application.yml in CI --- app/models/app_config.rb | 6 +++--- ci-19.sh | 2 +- ci.sh | 3 +-- lib/tasks/cruise.rake | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/models/app_config.rb b/app/models/app_config.rb index e9b06298b..f874d340d 100644 --- a/app/models/app_config.rb +++ b/app/models/app_config.rb @@ -5,14 +5,14 @@ require 'uri' class AppConfig < Settingslogic - def self.source_file - if Rails.env == 'test' + def self.source_file_name + if Rails.env == 'test' || ENV["CI"] File.join(Rails.root, "config", "application.yml.example") else File.join(Rails.root, "config", "application.yml") end end - source source_file + source source_file_name namespace Rails.env def self.load! diff --git a/ci-19.sh b/ci-19.sh index 88c641023..ecaf1deee 100755 --- a/ci-19.sh +++ b/ci-19.sh @@ -8,4 +8,4 @@ rm -f Gemfile.lock && source /usr/local/rvm/scripts/rvm && rvm use ruby-1.9.2-p0@diaspora --create && bundle install && -bundle exec rake cruise \ No newline at end of file +CI=true bundle exec rake cruise diff --git a/ci.sh b/ci.sh index e6b395ace..ee1685ea5 100755 --- a/ci.sh +++ b/ci.sh @@ -16,5 +16,4 @@ rm -rf /usr/local/rvm/gems/ree-1.8.7-2010.02@diaspora/cache && rm -rf /usr/local/rvm/gems/ree-1.8.7-2010.02@global/cache && rm -rf /usr/local/rvm/gems/ree-1.8.7-2010.02/cache && bundle install && -cp config/application.yml.example config/application.yml && -bundle exec rake cruise +CI=true bundle exec rake cruise diff --git a/lib/tasks/cruise.rake b/lib/tasks/cruise.rake index 484f68afd..9888385f4 100644 --- a/lib/tasks/cruise.rake +++ b/lib/tasks/cruise.rake @@ -4,7 +4,7 @@ namespace :cruise do puts "Starting virtual display..." `sh -e /etc/init.d/xvfb start` puts "Starting specs..." - system('export DISPLAY=:99.0 && bundle exec rake') + system('export DISPLAY=:99.0 && CI=true bundle exec rake') exit_status = $?.exitstatus puts "Stopping virtual display..." `sh -e /etc/init.d/xvfb stop`