mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-08 14:28:57 +02:00
[Nostromo] Rename TarGz tasks to just Tar
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?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\Task\BuiltIn\Deploy\Tar;
|
||||
|
||||
use Mage\Task\Exception\ErrorException;
|
||||
use Symfony\Component\Process\Process;
|
||||
use Mage\Task\AbstractTask;
|
||||
|
||||
/**
|
||||
* Tar Task - Delete temporal Tar
|
||||
*
|
||||
* @author Andrés Montañez <andresmontanez@gmail.com>
|
||||
*/
|
||||
class CleanupTask extends AbstractTask
|
||||
{
|
||||
public function getName()
|
||||
{
|
||||
return 'deploy/tar/cleanup';
|
||||
}
|
||||
|
||||
public function getDescription()
|
||||
{
|
||||
return '[Deploy] Cleanup Tar file';
|
||||
}
|
||||
|
||||
public function execute()
|
||||
{
|
||||
if (!$this->runtime->getEnvOption('releases', false)) {
|
||||
throw new ErrorException('This task is only available with releases enabled', 40);
|
||||
}
|
||||
|
||||
$tarLocal = $this->runtime->getVar('tar_local');
|
||||
|
||||
$cmdDeleteTar = sprintf('rm %s', $tarLocal);
|
||||
|
||||
/** @var Process $process */
|
||||
$process = $this->runtime->runLocalCommand($cmdDeleteTar);
|
||||
return $process->isSuccessful();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user