Permalink
Browse files

Added --env=#{symfony_env_prod} to every Symfony2 console command

  • Loading branch information...
1 parent 85d22dd commit 1aac46110d0a3b7c598eb004ae0e71d5af8af5f9 @ruudk ruudk committed May 3, 2011
Showing with 23 additions and 23 deletions.
  1. +23 −23 lib/symfony2.rb
View
@@ -69,7 +69,7 @@
desc "Migrate Symfony2 Doctrine ORM database."
task :migrate do
currentVersion = nil
- run "#{php-bin} #{app-path}/console doctrine:migrations:status" do |ch, stream, out|
+ run "#{php-bin} #{app-path}/console doctrine:migrations:status --env=#{symfony_env_prod}" do |ch, stream, out|
if stream == :out and out =~ /Current Version:[^$]+\(([0-9]+)\)/
currentVersion = Regexp.last_match(1)
end
@@ -84,14 +84,14 @@
puts "Current database version #{currentVersion}"
on_rollback {
- run "#{php-bin} #{app-path}/console doctrine:migrations:migrate #{currentVersion}" do |ch, stream, out|
+ run "#{php-bin} #{app-path}/console doctrine:migrations:migrate #{currentVersion} --env=#{symfony_env_prod}" do |ch, stream, out|
if out =~ /Are you sure you wish to continue/
ch.send_data("y\r\n")
end
end
}
- run "#{php-bin} #{app-path}/console doctrine:migrations:migrate" do |ch, stream, out|
+ run "#{php-bin} #{app-path}/console doctrine:migrations:migrate --env=#{symfony_env_prod}" do |ch, stream, out|
if out =~ /Are you sure you wish to continue/
ch.send_data("y\r\n")
end
@@ -104,13 +104,13 @@
task :default do
prompt_with_default(:task_arguments, "cache:clear")
- stream "cd #{latest_release} && #{php_bin} #{app_path}/console #{task_arguments}"
+ stream "cd #{latest_release} && #{php_bin} #{app_path}/console #{task_arguments} --env=#{symfony_env_prod}"
end
namespace :assets do
desc "Install bundle's assets"
task :install do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console assets:install #{web_path}"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console assets:install #{web_path} --env=#{symfony_env_prod}"
end
end
@@ -124,108 +124,108 @@
namespace :cache do
desc "Clears project cache."
task :clear do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console cache:clear"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console cache:clear --env=#{symfony_env_prod}"
end
desc "Warms up an empty cache."
task :warmup do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console cache:warmup"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console cache:warmup --env=#{symfony_env_prod}"
end
end
namespace :doctrine do
namespace :cache do
desc "Clear all metadata cache for a entity manager."
task :clear_metadata do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:cache:clear-metadata"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:cache:clear-metadata --env=#{symfony_env_prod}"
end
desc "Clear all query cache for a entity manager."
task :clear_query do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:cache:clear-query"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:cache:clear-query --env=#{symfony_env_prod}"
end
desc "Clear result cache for a entity manager."
task :clear_result do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:cache:clear-result"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:cache:clear-result --env=#{symfony_env_prod}"
end
end
namespace :database do
desc "Create the configured databases."
task :create do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:database:create"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:database:create --env=#{symfony_env_prod}"
end
desc "Drop the configured databases."
task :drop do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:database:drop"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:database:drop --env=#{symfony_env_prod}"
end
end
namespace :generate do
desc "Generates proxy classes for entity classes."
task :hydrators do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:generate:proxies"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:generate:proxies --env=#{symfony_env_prod}"
end
desc "Generate repository classes from your mapping information."
task :hydrators do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:generate:repositories"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:generate:repositories --env=#{symfony_env_prod}"
end
end
namespace :schema do
desc "Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output."
task :create do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:schema:create"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:schema:create --env=#{symfony_env_prod}"
end
desc "Drop the complete database schema of EntityManager Storage Connection or generate the corresponding SQL output."
task :drop do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:schema:drop"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:schema:drop --env=#{symfony_env_prod}"
end
end
namespace :migrations do
desc "Execute a migration to a specified version or the latest available version."
task :migrate do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:migrations:migrate"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:migrations:migrate --env=#{symfony_env_prod}"
end
desc "View the status of a set of migrations."
task :status do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:migrations:status"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:migrations:status --env=#{symfony_env_prod}"
end
end
namespace :mongodb do
namespace :generate do
desc "Generates hydrator classes for document classes."
task :hydrators do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:generate:hydrators"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:generate:hydrators --env=#{symfony_env_prod}"
end
desc "Generates proxy classes for document classes."
task :hydrators do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:generate:proxies"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:generate:proxies --env=#{symfony_env_prod}"
end
desc "Generates repository classes for document classes."
task :hydrators do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:generate:repositories"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:generate:repositories --env=#{symfony_env_prod}"
end
end
namespace :schema do
desc "Allows you to create databases, collections and indexes for your documents."
task :create do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:schema:create"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:schema:create --env=#{symfony_env_prod}"
end
desc "Allows you to drop databases, collections and indexes for your documents."
task :drop do
- run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:schema:drop"
+ run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:schema:drop --env=#{symfony_env_prod}"
end
end
end

0 comments on commit 1aac461

Please sign in to comment.