mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-04 00:50:18 +01:00 
			
		
		
		
	Fixes and tweaks.
This commit is contained in:
		
							parent
							
								
									fddeebe59a
								
							
						
					
					
						commit
						ec2bb12bf4
					
				@ -421,11 +421,11 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Runs a Task
 | 
					     * Runs a Task
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * @param string $task
 | 
					     * @param AbstractTask $task
 | 
				
			||||||
     * @param string $title
 | 
					     * @param string $title
 | 
				
			||||||
     * @return boolean
 | 
					     * @return boolean
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    protected function runTask($task, $title = null)
 | 
					    protected function runTask(AbstractTask $task, $title = null)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $task->init();
 | 
					        $task->init();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -68,9 +68,9 @@ class ReleasesCommand extends AbstractCommand implements RequiresEnvironment
 | 
				
			|||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    $releaseId = $this->getConfig()->getParameter('release', '');
 | 
					                    $releaseId = $this->getConfig()->getParameter('release', '');
 | 
				
			||||||
 | 
					                    $this->getConfig()->setReleaseId($releaseId);
 | 
				
			||||||
                    $task = Factory::get('releases/rollback', $this->getConfig());
 | 
					                    $task = Factory::get('releases/rollback', $this->getConfig());
 | 
				
			||||||
                    $task->init();
 | 
					                    $task->init();
 | 
				
			||||||
                    $task->setRelease($releaseId);
 | 
					 | 
				
			||||||
                    $result = $task->run();
 | 
					                    $result = $task->run();
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
				
			|||||||
@ -51,9 +51,9 @@ class RollbackCommand extends AbstractCommand implements RequiresEnvironment
 | 
				
			|||||||
            foreach ($hosts as $host) {
 | 
					            foreach ($hosts as $host) {
 | 
				
			||||||
                $this->getConfig()->setHost($host);
 | 
					                $this->getConfig()->setHost($host);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                $this->getConfig()->setReleaseId($releaseId);
 | 
				
			||||||
                $task = Factory::get('releases/rollback', $this->getConfig());
 | 
					                $task = Factory::get('releases/rollback', $this->getConfig());
 | 
				
			||||||
                $task->init();
 | 
					                $task->init();
 | 
				
			||||||
                $task->setRelease($releaseId);
 | 
					 | 
				
			||||||
                $result = $task->run();
 | 
					                $result = $task->run();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
@ -16,6 +16,7 @@ use Mage\Console\Colors;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
use Exception;
 | 
					use Exception;
 | 
				
			||||||
use RecursiveDirectoryIterator;
 | 
					use RecursiveDirectoryIterator;
 | 
				
			||||||
 | 
					use SplFileInfo;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Magallanes interface between the Tasks and Commands and the User's Console.
 | 
					 * Magallanes interface between the Tasks and Commands and the User's Console.
 | 
				
			||||||
@ -265,6 +266,7 @@ class Console
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            $logs = array();
 | 
					            $logs = array();
 | 
				
			||||||
            foreach (new RecursiveDirectoryIterator(getcwd() . '/.mage/logs', RecursiveDirectoryIterator::SKIP_DOTS) as $log) {
 | 
					            foreach (new RecursiveDirectoryIterator(getcwd() . '/.mage/logs', RecursiveDirectoryIterator::SKIP_DOTS) as $log) {
 | 
				
			||||||
 | 
					                /* @var $log SplFileInfo */
 | 
				
			||||||
                if (strpos($log->getFilename(), 'log-') === 0) {
 | 
					                if (strpos($log->getFilename(), 'log-') === 0) {
 | 
				
			||||||
                    $logs[] = $log->getFilename();
 | 
					                    $logs[] = $log->getFilename();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
				
			|||||||
@ -46,13 +46,6 @@ class ReleaseTask extends AbstractTask implements IsReleaseAware, SkipOnOverride
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            $releaseId = $this->getConfig()->getReleaseId();
 | 
					            $releaseId = $this->getConfig()->getReleaseId();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if ($this->getConfig()->release('compressreleases', false) == true) {
 | 
					 | 
				
			||||||
                // Tar.gz releases
 | 
					 | 
				
			||||||
                $result = $this->tarReleases() && $result;
 | 
					 | 
				
			||||||
                // Untar new release
 | 
					 | 
				
			||||||
                $result = $this->untarRelease($releaseId) && $result;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            $currentCopy = $releasesDirectory . '/' . $releaseId;
 | 
					            $currentCopy = $releasesDirectory . '/' . $releaseId;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            //Check if target user:group is specified
 | 
					            //Check if target user:group is specified
 | 
				
			||||||
 | 
				
			|||||||
@ -116,6 +116,7 @@ class RollbackTask extends AbstractTask implements IsReleaseAware
 | 
				
			|||||||
                        Console::output('Running <purple>' . $task->getName() . '</purple> ... ', 2, false);
 | 
					                        Console::output('Running <purple>' . $task->getName() . '</purple> ... ', 2, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        if ($task instanceOf RollbackAware) {
 | 
					                        if ($task instanceOf RollbackAware) {
 | 
				
			||||||
 | 
					                            /* @var $task AbstractTask */
 | 
				
			||||||
                            $tasks++;
 | 
					                            $tasks++;
 | 
				
			||||||
                            $result = $task->run();
 | 
					                            $result = $task->run();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -130,13 +131,6 @@ class RollbackTask extends AbstractTask implements IsReleaseAware
 | 
				
			|||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if ($this->getConfig()->release('compressreleases', false) == true) {
 | 
					 | 
				
			||||||
                        // Tar the current
 | 
					 | 
				
			||||||
                        $result = $this->tarReleases() && $result;
 | 
					 | 
				
			||||||
                        // Untar the rollbackto
 | 
					 | 
				
			||||||
                        $result = $this->untarRelease($releaseId) && $result;
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    // Changing Release
 | 
					                    // Changing Release
 | 
				
			||||||
                    Console::output('Running <purple>Rollback Release [id=' . $releaseId . ']</purple> ... ', 2, false);
 | 
					                    Console::output('Running <purple>Rollback Release [id=' . $releaseId . ']</purple> ... ', 2, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -167,6 +161,7 @@ class RollbackTask extends AbstractTask implements IsReleaseAware
 | 
				
			|||||||
                        Console::output('Running <purple>' . $task->getName() . '</purple> ... ', 2, false);
 | 
					                        Console::output('Running <purple>' . $task->getName() . '</purple> ... ', 2, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        if ($task instanceOf RollbackAware) {
 | 
					                        if ($task instanceOf RollbackAware) {
 | 
				
			||||||
 | 
					                            /* @var $task AbstractTask */
 | 
				
			||||||
                            $tasks++;
 | 
					                            $tasks++;
 | 
				
			||||||
                            $result = $task->run();
 | 
					                            $result = $task->run();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user