Instantly share code, notes, and snippets.

Embed
What would you like to do?
namespace :figaro do
desc "SCP transfer figaro configuration to the shared folder"
task :setup do
on roles(:app) do
upload! "config/application.yml", "#{shared_path}/application.yml", via: :scp
end
end
desc "Symlink application.yml to the release path"
task :symlink do
on roles(:app) do
execute "ln -sf #{shared_path}/application.yml #{current_path}/config/application.yml"
end
end
end
after "deploy:started", "figaro:setup"
after "deploy:symlink:release", "figaro:symlink"
@mckenn

This comment has been minimized.

Show comment
Hide comment
@mckenn

mckenn Jan 22, 2014

Thanks! How execute those tasks before migration task in case i store DB credentials in application.yml?

mckenn commented Jan 22, 2014

Thanks! How execute those tasks before migration task in case i store DB credentials in application.yml?

@mengqing

This comment has been minimized.

Show comment
Hide comment
@mengqing

mengqing Jul 10, 2014

should change

execute "ln -sf #{shared_path}/application.yml #{current_path}/config/application.yml"

after "deploy:symlink:release", "figaro:symlink"

to

execute "ln -sf #{shared_path}/application.yml #{release_path}/config/application.yml"

after 'deploy:updating', 'figaro:symlink'

otherwise rake db:migrate will fail if you have figaro references in initializers

mengqing commented Jul 10, 2014

should change

execute "ln -sf #{shared_path}/application.yml #{current_path}/config/application.yml"

after "deploy:symlink:release", "figaro:symlink"

to

execute "ln -sf #{shared_path}/application.yml #{release_path}/config/application.yml"

after 'deploy:updating', 'figaro:symlink'

otherwise rake db:migrate will fail if you have figaro references in initializers

@mckenn

This comment has been minimized.

Show comment
Hide comment
@mckenn

mckenn commented Oct 22, 2014

thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment