diff --git a/lib/capistrano/symfony/defaults.rb b/lib/capistrano/symfony/defaults.rb index fa19ae6..20dd0f8 100644 --- a/lib/capistrano/symfony/defaults.rb +++ b/lib/capistrano/symfony/defaults.rb @@ -51,5 +51,3 @@ # Assetic dump flags set :assetic_dump_flags, '' - -fetch(:default_env).merge!(symfony_env: fetch(:symfony_env)) diff --git a/lib/capistrano/tasks/set_symfony_env.rake b/lib/capistrano/tasks/set_symfony_env.rake new file mode 100644 index 0000000..39ceaf1 --- /dev/null +++ b/lib/capistrano/tasks/set_symfony_env.rake @@ -0,0 +1,9 @@ +namespace :deploy do + task :set_symfony_env do + fetch(:default_env).merge!(symfony_env: fetch(:symfony_env) || 'prod') + end +end + +Capistrano::DSL.stages.each do |stage| + after stage, 'deploy:set_symfony_env' +end diff --git a/lib/capistrano/tasks/symfony.rake b/lib/capistrano/tasks/symfony.rake index 5128d68..488df44 100644 --- a/lib/capistrano/tasks/symfony.rake +++ b/lib/capistrano/tasks/symfony.rake @@ -1,3 +1,5 @@ +load File.expand_path("../set_symfony_env.rake", __FILE__) + namespace :symfony do desc "Execute a provided symfony command" task :console, :command, :params, :role do |t, args|