diff --git a/Mage/Task/BuiltIn/Symfony2/AsseticDump.php b/Mage/Task/BuiltIn/Symfony2/AsseticDump.php new file mode 100644 index 0000000..405976b --- /dev/null +++ b/Mage/Task/BuiltIn/Symfony2/AsseticDump.php @@ -0,0 +1,20 @@ +getParameter('env', 'dev'); + + $command = 'app/console assetic:dump --env=' . $env; + $result = $this->_runLocalCommand($command); + + return $result; + } +} \ No newline at end of file diff --git a/Mage/Task/BuiltIn/Symfony2/AssetsInstall.php b/Mage/Task/BuiltIn/Symfony2/AssetsInstall.php new file mode 100644 index 0000000..09ec7b0 --- /dev/null +++ b/Mage/Task/BuiltIn/Symfony2/AssetsInstall.php @@ -0,0 +1,27 @@ +getParameter('target', 'web'); + $symlink = $this->getParameter('symlink', false); + $relative = $this->getParameter('relative', false); + $env = $this->getParameter('env', 'dev'); + + if ($relative) { + $symlink = true; + } + + $command = 'app/console assets:install ' . ($symlink ? '--symlink' : '') . ' ' . ($relative ? '--relative' : '') . ' --env=' . $env . ' ' . $target; + $result = $this->_runLocalCommand($command); + + return $result; + } +} \ No newline at end of file diff --git a/Mage/Task/BuiltIn/Symfony2/CacheClear.php b/Mage/Task/BuiltIn/Symfony2/CacheClear.php index 6fc0190..2a477f7 100644 --- a/Mage/Task/BuiltIn/Symfony2/CacheClear.php +++ b/Mage/Task/BuiltIn/Symfony2/CacheClear.php @@ -6,12 +6,15 @@ class Mage_Task_BuiltIn_Symfony2_CacheClear { return 'Symfony v2 - Cache Clear [built-in]'; } - + public function run() { - $command = 'app/console cache:clear'; + // Options + $env = $this->getParameter('env', 'dev'); + + $command = 'app/console cache:clear --env=' . $env; $result = $this->_runLocalCommand($command); - + return $result; } } \ No newline at end of file diff --git a/Mage/Task/BuiltIn/Symfony2/CacheWarmup.php b/Mage/Task/BuiltIn/Symfony2/CacheWarmup.php index 06b93fd..37f8ddc 100644 --- a/Mage/Task/BuiltIn/Symfony2/CacheWarmup.php +++ b/Mage/Task/BuiltIn/Symfony2/CacheWarmup.php @@ -9,8 +9,11 @@ class Mage_Task_BuiltIn_Symfony2_CacheWarmup public function run() { - $command = 'app/console cache:warmup'; - $result = $this->_runLocalCommand($command); + // Options + $env = $this->getParameter('env', 'dev'); + + $command = 'app/console cache:warmup --env=' . $env; + $result = $this->runCommand($command); return $result; } diff --git a/Mage/Task/BuiltIn/Symfony2/Migrate.php b/Mage/Task/BuiltIn/Symfony2/Migrate.php deleted file mode 100644 index fcdb4d2..0000000 --- a/Mage/Task/BuiltIn/Symfony2/Migrate.php +++ /dev/null @@ -1,17 +0,0 @@ -_runLocalCommand($command); - - return $result; - } -} diff --git a/docs/example-config/.mage/config/environment/production.yml b/docs/example-config/.mage/config/environment/production.yml index 4ff2629..46d5def 100644 --- a/docs/example-config/.mage/config/environment/production.yml +++ b/docs/example-config/.mage/config/environment/production.yml @@ -33,6 +33,7 @@ tasks: pre-deploy: - scm/update on-deploy: +# - symfony2/cache-warmup: {env: prod} - privileges - sampleTask - sampleTaskRollbackAware