Merge branch 'develop' of github.com:conversioncompany/Magallanes into develop

Conflicts:
	Mage/Task/Newcraft/Filesystem/ApplyFaclsTask.php
This commit is contained in:
Cedric Le Varlet 2015-10-15 16:53:22 +02:00
commit a2684f5121
4 changed files with 105 additions and 4 deletions

View file

@ -3,12 +3,13 @@
namespace Mage\Task\Newcraft\Composer;
use Mage\Task\BuiltIn\Composer\ComposerAbstractTask;
use Mage\Task\Releases\IsReleaseAware;
/**
* Class ACLPermissions
* @package Task
*/
class DownloadTask extends ComposerAbstractTask
class DownloadTask extends ComposerAbstractTask implements IsReleaseAware
{
/**
* @return string
@ -23,6 +24,7 @@ class DownloadTask extends ComposerAbstractTask
*/
public function run()
{
return $this->runCommandRemote('curl -sS https://getcomposer.org/installer | php');
$downloadCommand = $this->getReleasesAwareCommand('curl -sS https://getcomposer.org/installer | php');
return $this->runCommandRemote($downloadCommand);
}
}

View file

@ -0,0 +1,32 @@
<?php
namespace Mage\Task\Newcraft\Composer;
use Mage\Task\BuiltIn\Composer\ComposerAbstractTask;
use Mage\Task\ErrorWithMessageException;
use Mage\Task\Releases\IsReleaseAware;
class InstallTask extends ComposerAbstractTask implements IsReleaseAware
{
/**
* Returns the Title of the Task
* @return string
*/
public function getName()
{
return 'Install vendors via Composer [built-in]';
}
/**
* Runs the task
*
* @return boolean
* @throws ErrorWithMessageException
*/
public function run()
{
$dev = $this->getParameter('dev', true);
$installCommand = $this->getReleasesAwareCommand($this->getComposerCmd() . ' install' . ($dev ? ' --dev' : ' --no-dev'));
return $this->runCommandRemote($installCommand);
}
}

View file

@ -41,10 +41,12 @@ class ApplyFaclsTask extends AbstractTask implements IsReleaseAware
$return = true;
foreach ($folders as $folder) {
$aclCommand = $this->getReleasesAwareCommand('setfacl'.$flags.' '.$aclParam.' '.$folder);
$execute = $this->runCommandRemote($aclCommand, $output);
if(!$execute) $return = false;
if (!$execute) {
$return = false;
}
}
return $return;

View file

@ -0,0 +1,65 @@
<?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\Newcraft\Symfony2;
use Mage\Task\BuiltIn\Symfony2\SymfonyAbstractTask;
/**
* Task for Dumping Assetics
*
* @author Andrés Montañez <andres@andresmontanez.com>
*/
class CopyParametersTask extends SymfonyAbstractTask
{
/**
* (non-PHPdoc)
* @see \Mage\Task\AbstractTask::getName()
*/
public function getName()
{
return 'Symfony v2 - Prepare parameters.yml [newcraft]';
}
/**
* Dumps Assetics
* @see \Mage\Task\AbstractTask::run()
*/
public function run()
{
$envName = $this->getConfig()->deployment('environment');
//First check if parameters.yml exists
$parametersYmlExistsCommand = $this->getReleasesAwareCommand('cd ./app/config && test -f parameters.yml && echo "y" || echo "n"');
if( $this->runCommandRemote($parametersYmlExistsCommand, $output) && $output == 'y') {
if($removeParametersCommand = $this->getReleasesAwareCommand('cd ./app/config && rm parameters.yml')) {
return $this->copyParameters($envName);
} else {
return false;
}
} else {
return $this->copyParameters($envName);
}
}
/**
* Copies the parameters-{envName}.yml to parameters.yml
* @param $envName
* @return bool
*/
public function copyParameters($envName) {
$environmentYmlExistsCommand = $this->getReleasesAwareCommand('cd ./app/config && test -f parameters-'.$envName.'.yml && echo "y" || echo "n"');
if( $this->runCommandRemote($environmentYmlExistsCommand, $output) && $output == 'y') {
return $this->getReleasesAwareCommand('cd ./app/config && cp -p parameters-'.$envName.'.yml parameters.yml');
} else {
return false;
}
}
}