Skip to content

Instantly share code, notes, and snippets.

@borisguery
Created July 9, 2013 09:58
Show Gist options
  • Save borisguery/5956164 to your computer and use it in GitHub Desktop.
Save borisguery/5956164 to your computer and use it in GitHub Desktop.
Upload parameters according to the current stage in capistrano
task :upload_parameters do
desc 'Upload stage parameters'
capifony_pretty_print '--> Uploading stage parameters'
origin_file = "app/config/parameters.#{fetch(:stage)}.yml"
destination_file = deploy_to + '/' + shared_dir + '/app/config/parameters.yml'
run "sh -c 'if [ ! -d #{File.dirname(destination_file)} ] ; then mkdir -p #{File.dirname(destination_file)}; fi'"
top.upload(origin_file, destination_file)
capifony_puts_ok
end
before 'deploy:share_childs', 'upload_parameters'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment