[Nostromo] Refactor some tasks, add new tests

This commit is contained in:
Andrés Montañez
2017-01-05 20:38:42 -03:00
parent 781b5e7620
commit 68e65827fa
22 changed files with 291 additions and 62 deletions
@@ -18,25 +18,25 @@ use Mage\Task\AbstractTask;
*
* @author Andrés Montañez <andresmontanez@gmail.com>
*/
class GenerateAutoloadTask extends AbstractTask
class DumpAutoloadTask extends AbstractTask
{
public function getName()
{
return 'composer/generate-autoload';
return 'composer/dump-autoload';
}
public function getDescription()
{
return '[Composer] Generate Autoload';
return '[Composer] Dump Autoload';
}
public function execute()
{
$options = $this->getOptions();
$command = $options['path'] . ' dumpautoload ' . $options['flags'];
$command = sprintf('%s dump-autoload %s', $options['path'], $options['flags']);
/** @var Process $process */
$process = $this->runtime->runCommand($command);
$process = $this->runtime->runCommand(trim($command));
return $process->isSuccessful();
}
@@ -33,10 +33,10 @@ class InstallTask extends AbstractTask
public function execute()
{
$options = $this->getOptions();
$command = trim($options['path'] . ' install ' . $options['flags']);
$command = sprintf('%s install %s', $options['path'], $options['flags']);
/** @var Process $process */
$process = $this->runtime->runCommand($command);
$process = $this->runtime->runCommand(trim($command));
return $process->isSuccessful();
}
@@ -45,7 +45,7 @@ class InstallTask extends AbstractTask
{
$userOptions = $this->runtime->getConfigOptions('composer', []);
$options = array_merge(
['path' => 'composer', 'flags' => ''],
['path' => 'composer', 'flags' => '--optimize-autoloader'],
(is_array($userOptions) ? $userOptions : []),
$this->options
);
@@ -33,20 +33,22 @@ class AsseticDumpTask extends AbstractTask
public function execute()
{
$options = $this->getOptions();
$command = $options['console'] . ' assetic:dump --env=' . $options['env'] . ' ' . $options['flags'];
$command = sprintf('%s assetic:dump --env=%s %s', $options['console'], $options['env'], $options['flags']);
/** @var Process $process */
$process = $this->runtime->runCommand($command);
$process = $this->runtime->runCommand(trim($command));
return $process->isSuccessful();
}
protected function getOptions()
{
$userOptions = $this->runtime->getConfigOptions('symfony', []);
$userGlobalOptions = $this->runtime->getConfigOptions('symfony', []);
$userEnvironmentOptions = $this->runtime->getEnvironmentConfig('symfony', []);
$options = array_merge(
['console' => 'bin/console', 'env' => 'dev', 'flags' => ''],
(is_array($userOptions) ? $userOptions : []),
(is_array($userGlobalOptions) ? $userGlobalOptions : []),
(is_array($userEnvironmentOptions) ? $userEnvironmentOptions : []),
$this->options
);
@@ -33,20 +33,22 @@ class AssetsInstallTask extends AbstractTask
public function execute()
{
$options = $this->getOptions();
$command = $options['console'] . ' assets:install --env=' . $options['env'] . ' ' . $options['flags'] . ' ' . $options['target'];
$command = sprintf('%s assets:install %s --env=%s %s', $options['console'], $options['target'], $options['env'], $options['flags']);
/** @var Process $process */
$process = $this->runtime->runCommand($command);
$process = $this->runtime->runCommand(trim($command));
return $process->isSuccessful();
}
protected function getOptions()
{
$userOptions = $this->runtime->getConfigOptions('symfony', []);
$userGlobalOptions = $this->runtime->getConfigOptions('symfony', []);
$userEnvironmentOptions = $this->runtime->getEnvironmentConfig('symfony', []);
$options = array_merge(
['console' => 'bin/console', 'env' => 'dev', 'target' => 'web', 'flags' => '--symlink --relative'],
(is_array($userOptions) ? $userOptions : []),
(is_array($userGlobalOptions) ? $userGlobalOptions : []),
(is_array($userEnvironmentOptions) ? $userEnvironmentOptions : []),
$this->options
);
@@ -36,17 +36,19 @@ class CacheClearTask extends AbstractTask
$command = $options['console'] . ' cache:clear --env=' . $options['env'] . ' ' . $options['flags'];
/** @var Process $process */
$process = $this->runtime->runCommand($command);
$process = $this->runtime->runCommand(trim($command));
return $process->isSuccessful();
}
protected function getOptions()
{
$userOptions = $this->runtime->getConfigOptions('symfony', []);
$userGlobalOptions = $this->runtime->getConfigOptions('symfony', []);
$userEnvironmentOptions = $this->runtime->getEnvironmentConfig('symfony', []);
$options = array_merge(
['console' => 'bin/console', 'env' => 'dev', 'flags' => ''],
(is_array($userOptions) ? $userOptions : []),
(is_array($userGlobalOptions) ? $userGlobalOptions : []),
(is_array($userEnvironmentOptions) ? $userEnvironmentOptions : []),
$this->options
);
@@ -36,17 +36,19 @@ class CacheWarmupTask extends AbstractTask
$command = $options['console'] . ' cache:warmup --env=' . $options['env'] . ' ' . $options['flags'];
/** @var Process $process */
$process = $this->runtime->runCommand($command);
$process = $this->runtime->runCommand(trim($command));
return $process->isSuccessful();
}
protected function getOptions()
{
$userOptions = $this->runtime->getConfigOptions('symfony', []);
$userGlobalOptions = $this->runtime->getConfigOptions('symfony', []);
$userEnvironmentOptions = $this->runtime->getEnvironmentConfig('symfony', []);
$options = array_merge(
['console' => 'bin/console', 'env' => 'dev', 'flags' => ''],
(is_array($userOptions) ? $userOptions : []),
(is_array($userGlobalOptions) ? $userGlobalOptions : []),
(is_array($userEnvironmentOptions) ? $userEnvironmentOptions : []),
$this->options
);
@@ -0,0 +1,104 @@
<?php
/*
* This file is part of the Magallanes package.
*
* (c) Andrés Montañez <andres@andresmontanez.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Mage\Tests\Command\BuiltIn;
use Mage\Command\BuiltIn\DeployCommand;
use Mage\Tests\MageApplicationMockup;
use Mage\Command\AbstractCommand;
use Mage\Runtime\Exception\RuntimeException;
use Exception;
use Symfony\Component\Console\Tester\CommandTester;
use PHPUnit_Framework_TestCase as TestCase;
class DeployCommandMiscTasksTest extends TestCase
{
public function testSymfonyEnvironmentConfiguration()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/symfony-envconf.yml');
/** @var AbstractCommand $command */
$command = $application->find('deploy');
$this->assertTrue($command instanceof DeployCommand);
$tester = new CommandTester($command);
$tester->execute(['command' => $command->getName(), 'environment' => 'test']);
$ranCommands = $application->getRuntime()->getRanCommands();
$testCase = array(
0 => 'rsync -e "ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -avz --exclude=.git --exclude=./var/cache/* --exclude=./var/log/* --exclude=./web/app_dev.php ./ tester@testhost:/var/www/test',
1 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console cache:warmup --env=testenv\\"',
2 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console assets:install web --env=testenv --symlink --relative\\"',
3 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console assetic:dump --env=testenv\\"',
4 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console assetic:dump --env=prod\\"',
);
// Check total of Executed Commands
$this->assertEquals(count($testCase), count($ranCommands));
// Check Generated Commands
foreach ($testCase as $index => $command) {
$this->assertEquals($command, $ranCommands[$index]);
}
$this->assertEquals(0, $tester->getStatusCode());
}
public function testComposerFlags()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/composer.yml');
/** @var AbstractCommand $command */
$command = $application->find('deploy');
$this->assertTrue($command instanceof DeployCommand);
$tester = new CommandTester($command);
$tester->execute(['command' => $command->getName(), 'environment' => 'test']);
$ranCommands = $application->getRuntime()->getRanCommands();
$testCase = array(
0 => '/usr/bin/composer.phar install --prefer-source',
1 => '/usr/bin/composer.phar dump-autoload --no-scripts',
2 => 'rsync -e "ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -avz --exclude=.git --exclude=./var/cache/* --exclude=./var/log/* --exclude=./web/app_dev.php ./ tester@testhost:/var/www/test',
);
// Check total of Executed Commands
$this->assertEquals(count($testCase), count($ranCommands));
// Check Generated Commands
foreach ($testCase as $index => $command) {
$this->assertEquals($command, $ranCommands[$index]);
}
$this->assertEquals(0, $tester->getStatusCode());
}
public function testInvalidTaskName()
{
$application = new MageApplicationMockup();
$application->configure(__DIR__ . '/../../Resources/invalid-task.yml');
/** @var AbstractCommand $command */
$command = $application->find('deploy');
$this->assertTrue($command instanceof DeployCommand);
try {
$tester = new CommandTester($command);
$tester->execute(['command' => $command->getName(), 'environment' => 'test']);
} catch (Exception $exception) {
$this->assertTrue($exception instanceof RuntimeException);
$this->assertEquals('Invalid task name "invalid/task"', $exception->getMessage());
}
}
}
@@ -36,13 +36,13 @@ class DeployCommandMiscTest extends TestCase
0 => 'git branch | grep "*"',
1 => 'git checkout test',
2 => 'git pull',
3 => 'composer install',
4 => 'composer dumpautoload --optimize',
3 => 'composer install --optimize-autoloader',
4 => 'composer dump-autoload --optimize',
5 => 'rsync -e "ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -avz --exclude=.git --exclude=./var/cache/* --exclude=./var/log/* --exclude=./web/app_dev.php ./ tester@testhost:/var/www/test',
6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& sudo bin/console cache:clear --env=dev \\"',
7 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& sudo bin/console cache:warmup --env=dev \\"',
8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& sudo bin/console assets:install --env=dev --symlink --relative web\\"',
9 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& sudo bin/console assetic:dump --env=dev \\"',
6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& sudo bin/console cache:clear --env=dev\\"',
7 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& sudo bin/console cache:warmup --env=dev\\"',
8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& sudo bin/console assets:install web --env=dev --symlink --relative\\"',
9 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& sudo bin/console assetic:dump --env=dev\\"',
10 => 'git checkout master',
);
@@ -75,12 +75,12 @@ class DeployCommandMiscTest extends TestCase
0 => 'git branch | grep "*"',
1 => 'git checkout maintenance',
2 => 'git pull',
3 => 'composer install',
4 => 'composer dumpautoload --optimize',
3 => 'composer install --optimize-autoloader',
4 => 'composer dump-autoload --optimize',
5 => 'rsync -e "ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -avz --exclude=.git --exclude=./var/cache/* --exclude=./var/log/* --exclude=./web/app_dev.php ./ tester@testhost:/var/www/test',
6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console cache:warmup --env=dev \\"',
7 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console assets:install --env=dev --symlink --relative web\\"',
8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console assetic:dump --env=dev \\"',
6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console cache:warmup --env=dev\\"',
7 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console assets:install web --env=dev --symlink --relative\\"',
8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console assetic:dump --env=dev\\"',
9 => 'git checkout master',
);
@@ -111,8 +111,8 @@ class DeployCommandMiscTest extends TestCase
$ranCommands = $application->getRuntime()->getRanCommands();
$testCase = array(
0 => 'composer install',
1 => 'composer dumpautoload --optimize',
0 => 'composer install --optimize-autoloader',
1 => 'composer dump-autoload --optimize',
2 => 'rsync -e "ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -avz --exclude=.git --exclude=./var/cache/* --exclude=./var/log/* --exclude=./web/app_dev.php ./ tester@testhost:/var/www/test',
);
@@ -149,8 +149,8 @@ class DeployCommandMiscTest extends TestCase
0 => 'git branch | grep "*"',
1 => 'git checkout test',
2 => 'git pull',
3 => 'composer install',
4 => 'composer dumpautoload --optimize',
3 => 'composer install --optimize-autoloader',
4 => 'composer dump-autoload --optimize',
5 => 'tar cfz /tmp/mageXYZ --exclude=".git" --exclude="./var/cache/*" --exclude="./var/log/*" --exclude="./web/app_dev.php" ./',
6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"mkdir -p /var/www/test/releases/1234567890\\"',
7 => 'scp -P 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /tmp/mageXYZ tester@testhost:/var/www/test/releases/1234567890/mageXYZ',
@@ -189,8 +189,8 @@ class DeployCommandMiscTest extends TestCase
0 => 'git branch | grep "*"',
1 => 'git checkout test',
2 => 'git pull',
3 => 'composer install',
4 => 'composer dumpautoload --optimize',
3 => 'composer install --optimize-autoloader',
4 => 'composer dump-autoload --optimize',
5 => 'rsync -e "ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -avz --exclude=.git --exclude=./var/cache/* --exclude=./var/log/* --exclude=./web/app_dev.php ./ tester@testhost:/var/www/test',
6 => 'git checkout master',
);
@@ -225,12 +225,12 @@ class DeployCommandMiscTest extends TestCase
$testCase = array(
0 => 'git branch | grep "*"',
1 => 'git pull',
2 => 'composer install',
3 => 'composer dumpautoload --optimize',
2 => 'composer install --optimize-autoloader',
3 => 'composer dump-autoload --optimize',
4 => 'rsync -e "ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -avz --exclude=.git --exclude=./var/cache/* --exclude=./var/log/* --exclude=./web/app_dev.php ./ tester@testhost:/var/www/test',
5 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console cache:warmup --env=dev \\"',
6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console assets:install --env=dev --symlink --relative web\\"',
7 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console assetic:dump --env=dev \\"',
5 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console cache:warmup --env=dev\\"',
6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console assets:install web --env=dev --symlink --relative\\"',
7 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console assetic:dump --env=dev\\"',
8 => 'git branch | grep "*"',
);
@@ -38,16 +38,16 @@ class DeployCommandWithReleasesTest extends TestCase
0 => 'git branch | grep "*"',
1 => 'git checkout test',
2 => 'git pull',
3 => 'composer install',
4 => 'composer dumpautoload --optimize',
3 => 'composer install --optimize-autoloader',
4 => 'composer dump-autoload --optimize',
5 => 'tar cfz /tmp/mageXYZ --exclude=".git" --exclude="./var/cache/*" --exclude="./var/log/*" --exclude="./web/app_dev.php" ./',
6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"mkdir -p /var/www/test/releases/1234567890\\"',
7 => 'scp -P 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /tmp/mageXYZ tester@testhost:/var/www/test/releases/1234567890/mageXYZ',
8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test/releases/1234567890 \\&\\& tar xfz mageXYZ\\"',
9 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"rm /var/www/test/releases/1234567890/mageXYZ\\"',
10 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test/releases/1234567890 \\&\\& bin/console cache:warmup --env=dev \\"',
11 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test/releases/1234567890 \\&\\& bin/console assets:install --env=dev --symlink --relative web\\"',
12 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test/releases/1234567890 \\&\\& bin/console assetic:dump --env=dev \\"',
10 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test/releases/1234567890 \\&\\& bin/console cache:warmup --env=dev\\"',
11 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test/releases/1234567890 \\&\\& bin/console assets:install web --env=dev --symlink --relative\\"',
12 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test/releases/1234567890 \\&\\& bin/console assetic:dump --env=dev\\"',
13 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& ln -snf releases/1234567890 current\\"',
14 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"ls -1 /var/www/test/releases\\"',
15 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"rm -rf /var/www/test/releases/20170101015110\\"',
@@ -36,12 +36,12 @@ class DeployCommandWithoutReleasesTest extends TestCase
0 => 'git branch | grep "*"',
1 => 'git checkout test',
2 => 'git pull',
3 => 'composer install',
4 => 'composer dumpautoload --optimize',
3 => 'composer install --optimize-autoloader',
4 => 'composer dump-autoload --optimize',
5 => 'rsync -e "ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" -avz --exclude=.git --exclude=./var/cache/* --exclude=./var/log/* --exclude=./web/app_dev.php ./ tester@testhost:/var/www/test',
6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console cache:warmup --env=dev \\"',
7 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console assets:install --env=dev --symlink --relative web\\"',
8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console assetic:dump --env=dev \\"',
6 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console cache:warmup --env=dev\\"',
7 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console assets:install web --env=dev --symlink --relative\\"',
8 => 'ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no tester@testhost sh -c \\"cd /var/www/test \\&\\& bin/console assetic:dump --env=dev\\"',
9 => 'git checkout master',
);
+1 -1
View File
@@ -17,7 +17,7 @@ magephp:
pre-deploy:
- git/update
- composer/install
- composer/generate-autoload
- composer/dump-autoload
on-deploy:
- symfony/cache-warmup: { env: 'dev' }
- symfony/assets-install: { env: 'dev' }
+17
View File
@@ -0,0 +1,17 @@
magephp:
log_dir: /tmp
composer:
path: /usr/bin/composer.phar
environments:
test:
user: tester
host_path: /var/www/test
exclude:
- ./var/cache/*
- ./var/log/*
- ./web/app_dev.php
hosts:
- testhost
pre-deploy:
- composer/install: { flags: '--prefer-source' }
- composer/dump-autoload: { flags: '--no-scripts' }
+14
View File
@@ -0,0 +1,14 @@
magephp:
log_dir: /tmp
environments:
test:
user: tester
host_path: /var/www/test
exclude:
- ./var/cache/*
- ./var/log/*
- ./web/app_dev.php
hosts:
- testhost
pre-deploy:
- invalid/task
@@ -0,0 +1,18 @@
magephp:
log_dir: /tmp
environments:
test:
symfony: { env: 'testenv' }
user: tester
host_path: /var/www/test
exclude:
- ./var/cache/*
- ./var/log/*
- ./web/app_dev.php
hosts:
- testhost
on-deploy:
- symfony/cache-warmup
- symfony/assets-install
- symfony/assetic-dump
- symfony/assetic-dump: { env: 'prod' }
@@ -12,7 +12,7 @@ magephp:
- testhost
pre-deploy:
- composer/install
- composer/generate-autoload
- composer/dump-autoload
on-deploy:
- Mage\Tests\Task\CustomTask
on-release:
@@ -14,7 +14,7 @@ magephp:
pre-deploy:
- git/update
- composer/install
- composer/generate-autoload
- composer/dump-autoload
on-deploy:
- symfony/cache-warmup: { env: 'dev' }
- symfony/assets-install: { env: 'dev' }
+1 -1
View File
@@ -15,7 +15,7 @@ magephp:
pre-deploy:
- git/update
- composer/install
- composer/generate-autoload
- composer/dump-autoload
on-deploy:
- symfony/cache-clear: { env: 'dev' }
- symfony/cache-warmup: { env: 'dev' }
@@ -15,7 +15,7 @@ magephp:
pre-deploy:
- git/update
- composer/install
- composer/generate-autoload
- composer/dump-autoload
on-deploy:
- deploy/rsync
on-release:
@@ -14,7 +14,7 @@ magephp:
pre-deploy:
- git/update
- composer/install
- composer/generate-autoload
- composer/dump-autoload
on-deploy:
- deploy/rsync
on-release:
@@ -14,7 +14,7 @@ magephp:
pre-deploy:
- git/update
- composer/install
- composer/generate-autoload
- composer/dump-autoload
on-deploy:
- symfony/cache-warmup: { env: 'dev' }
- symfony/assets-install: { env: 'dev' }
+1 -1
View File
@@ -15,7 +15,7 @@ magephp:
pre-deploy:
- git/update
- composer/install
- composer/generate-autoload
- composer/dump-autoload
on-deploy:
- symfony/cache-warmup: { env: 'dev' }
- symfony/assets-install: { env: 'dev' }