Permalink
Browse files

Load settings from global yaml

  • Loading branch information...
1 parent d145574 commit a9e2e2f43854748de36e69667aec3016d382de15 @tobi committed Aug 24, 2009
Showing with 13 additions and 2 deletions.
  1. +6 −1 config/deploy.rb
  2. +7 −1 config/env.rb
View
@@ -23,11 +23,16 @@
task :update_code, :except => { :no_release => true } do
run "cd #{current_path}; git fetch origin; git reset --hard #{branch}; git tag '#{deploy_type}-#{Time.now.to_i}'"
end
+
+ desc "List deployment tags for use with deploy:rollback TAG="
+ task :list_tags, :except => { :no_release => true } do
+ run "cd #{current_path}; git tag -l 'deploy*' -n 3"
+ end
namespace :rollback do
desc "Rollback a single commit."
task :default, :except => { :no_release => true } do
- branch = capture("cd #{current_path}; git tag -l 'deploy*' | tail -n2 | head -n1")
+ branch = ENV['TAG'] || capture("cd #{current_path}; git tag -l 'deploy*' | tail -n2 | head -n1")
set :deploy_type, 'rollback'
set :branch, branch
deploy.default
View
@@ -1,10 +1,15 @@
# Image server configuration file
RACK_ENV = ENV['RACK_ENV'] || 'development'
+$settings = if File.exist?('/etc/imagery/config.yml')
+ YAML.load_file('/etc/imagery/config.yml')
+else
+ {}
+end
# Upstream Server where the assets live
-ORIGIN_SERVER = ENV['ORIGIN_SERVER'] || 'static.shopify.com'
+ORIGIN_SERVER = $settings['origin_server'] || 'shopify.s3.amazonaws.com'
# Middleware configuration
@@ -18,3 +23,4 @@
# Logging
Logger.current = RequestAwareLogger.new(File.dirname(__FILE__) + "/../log/#{RACK_ENV}.log")
+

0 comments on commit a9e2e2f

Please sign in to comment.