Created
January 23, 2014 14:29
-
-
Save mashiro/8579330 to your computer and use it in GitHub Desktop.
明示した変数だけ環境変数で上書きできる感じのやつ
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
# vim: ft=ruby | |
namespace 'load' do | |
task :defaults do | |
set :overridable_attributes, :branch | |
end | |
task :override do | |
attrs = Array(fetch(:overridable_attributes)).compact | |
attrs.each do |attr| | |
name = attr.to_s.upcase | |
set attr, ENV[name] if ENV[name] | |
end | |
end | |
end | |
Capistrano::DSL.stages.each do |stage| | |
after stage, 'load:override' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment