Merge pull request #357 from bennsel/master

[FEATURE] allow exclude definition global
This commit is contained in:
Andrés Montañez 2017-04-14 16:19:14 -03:00 committed by GitHub
commit c649814158
4 changed files with 39 additions and 4 deletions

View file

@ -54,7 +54,7 @@ class RsyncTask extends AbstractTask
protected function getExcludes()
{
$excludes = $this->runtime->getEnvOption('exclude', []);
$excludes = $this->runtime->getMergedOption('exclude', []);
$excludes = array_merge(['.git'], array_filter($excludes));
foreach ($excludes as &$exclude) {

View file

@ -51,7 +51,7 @@ class PrepareTask extends AbstractTask
protected function getExcludes()
{
$excludes = $this->runtime->getEnvOption('exclude', []);
$excludes = $this->runtime->getMergedOption('exclude', []);
$excludes = array_merge(['.git'], array_filter($excludes));
foreach ($excludes as &$exclude) {

View file

@ -50,9 +50,27 @@ class DeployCommandMiscTasksTest extends TestCase
$this->assertEquals(0, $tester->getStatusCode());
}
public function testComposerFlags()
public function composerFlagsDataProvider() {
return [
'default' => [
'yml' => __DIR__ . '/../../Resources/composer.yml'
],
'global exclude' => [
'yml' => __DIR__ . '/../../Resources/global-exclude.yml'
],
];
}
/**
* testComposerFlags
*
* @dataProvider composerFlagsDataProvider
* @param string $yml
* @return void
*/
public function testComposerFlags($yml)
{
$application = new MageApplicationMockup(__DIR__ . '/../../Resources/composer.yml');
$application = new MageApplicationMockup($yml);
/** @var AbstractCommand $command */
$command = $application->find('deploy');

View file

@ -0,0 +1,17 @@
magephp:
log_dir: /tmp
composer:
path: /usr/bin/composer.phar
exclude:
- ./var/cache/*
- ./var/log/*
- ./web/app_dev.php
environments:
test:
user: tester
host_path: /var/www/test
hosts:
- testhost
pre-deploy:
- composer/install: { flags: '--prefer-source' }
- composer/dump-autoload: { flags: '--no-scripts' }