mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-04 00:50:18 +01:00 
			
		
		
		
	[FEATURE] allow exclude definition global
This commit is contained in:
		
							parent
							
								
									1ebe6c4ba7
								
							
						
					
					
						commit
						91f246b579
					
				@ -54,7 +54,7 @@ class RsyncTask extends AbstractTask
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    protected function getExcludes()
 | 
					    protected function getExcludes()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $excludes = $this->runtime->getEnvOption('exclude', []);
 | 
					        $excludes = $this->runtime->getMergedOption('exclude', []);
 | 
				
			||||||
        $excludes = array_merge(['.git'], array_filter($excludes));
 | 
					        $excludes = array_merge(['.git'], array_filter($excludes));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        foreach ($excludes as &$exclude) {
 | 
					        foreach ($excludes as &$exclude) {
 | 
				
			||||||
 | 
				
			|||||||
@ -51,7 +51,7 @@ class PrepareTask extends AbstractTask
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    protected function getExcludes()
 | 
					    protected function getExcludes()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $excludes = $this->runtime->getEnvOption('exclude', []);
 | 
					        $excludes = $this->runtime->getMergedOption('exclude', []);
 | 
				
			||||||
        $excludes = array_merge(['.git'], array_filter($excludes));
 | 
					        $excludes = array_merge(['.git'], array_filter($excludes));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        foreach ($excludes as &$exclude) {
 | 
					        foreach ($excludes as &$exclude) {
 | 
				
			||||||
 | 
				
			|||||||
@ -50,9 +50,27 @@ class DeployCommandMiscTasksTest extends TestCase
 | 
				
			|||||||
        $this->assertEquals(0, $tester->getStatusCode());
 | 
					        $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 */
 | 
					        /** @var AbstractCommand $command */
 | 
				
			||||||
        $command = $application->find('deploy');
 | 
					        $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 New Issue
	
	Block a user