Skip to content

Instantly share code, notes, and snippets.

@javiermadueno
Forked from jmather/deploy.rb
Last active September 22, 2015 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javiermadueno/653b00c6723fc7686448 to your computer and use it in GitHub Desktop.
Save javiermadueno/653b00c6723fc7686448 to your computer and use it in GitHub Desktop.
Remove dev only files in production via capifony
set :dev_only_files, [web_path + "/app_dev.php", web_path + "/check.php", web_path + "/config.php"]
set :production, true
after 'symfony:cache:warmup', 'pff:productify'
namespace :pff do
desc "Remove app_dev.php, check.php and config.php from production deployment"
task :productify, :except => { :production => false } do
if dev_only_files
pretty_print "--> Removing app_dev.php, config.php, and check.php from web"
dev_only_files.map do |dev_file|
run "rm -f #{latest_release}/#{dev_file}"
end
puts_ok
else
pretty_print "--> We wanted to remove dev only files but none were listed"
puts_ok
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment