Created
July 9, 2013 09:58
-
-
Save borisguery/5956164 to your computer and use it in GitHub Desktop.
Upload parameters according to the current stage in capistrano
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
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