lib/mascherano/tasks/figaro.cap in mascherano-1.1.0 vs lib/mascherano/tasks/figaro.cap in mascherano-1.2.0

- old
+ new

@@ -4,13 +4,15 @@ desc <<-DESC Upload application config to the server You can override any of these defaults by setting the variables shown below. - set :figaro_target, -> { shared_path.join('application.yml') } - set :figaro_config, -> { release_path.join('config', 'application.yml') } - set :figaro_to_env, false + set :figaro_target, -> { shared_path.join('application.yml') } + set :figaro_config, -> { release_path.join('config', 'application.yml') } + set :figaro_to_env, false + set :figaro_roles, :app + set :figaro_servers, -> { release_roles(fetch(:figaro_roles)) } DESC task :upload do figaro_data = nil run_locally do @@ -25,31 +27,32 @@ figaro_data = capture(:rails, "runner 'puts #{figaro_cmd}'") end if figaro_data - on roles(fetch(:figaro_roles)) do + on fetch(:figaro_servers) do upload! StringIO.new(figaro_data), fetch(:figaro_target) end end end desc <<-DESC Symlink the application config to the release_path DESC task :symlink do - on roles(fetch(:figaro_roles)) do + on fetch(:figaro_servers) do execute :ln, '-sf', fetch(:figaro_target), fetch(:figaro_config) end end end namespace :load do task :defaults do - set :figaro_target, -> { shared_path.join('application.yml') } - set :figaro_config, -> { release_path.join('config', 'application.yml') } - set :figaro_to_env, false - set :figaro_roles, :app + set :figaro_target, -> { shared_path.join('application.yml') } + set :figaro_config, -> { release_path.join('config', 'application.yml') } + set :figaro_to_env, false + set :figaro_roles, :app + set :figaro_servers, -> { release_roles(fetch(:figaro_roles)) } end end namespace :deploy do after :updating, 'figaro:symlink'