mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-05-23 16:12:11 +02:00
Merge pull request #357 from bennsel/master
[FEATURE] allow exclude definition global
This commit is contained in:
commit
c649814158
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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');
|
||||
|
|
17
tests/Resources/global-exclude.yml
Normal file
17
tests/Resources/global-exclude.yml
Normal 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' }
|
Loading…
Reference in a new issue