mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-04 00:50:18 +01:00 
			
		
		
		
	Add sample config for Magallanes' built-in commands
This commit is contained in:
		
							parent
							
								
									c49d36a91a
								
							
						
					
					
						commit
						5db9905ed4
					
				@ -23,6 +23,21 @@ use Exception;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
class AddCommand extends AbstractCommand
 | 
					class AddCommand extends AbstractCommand
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    public function __construct()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->setName('Add command')
 | 
				
			||||||
 | 
					            ->setHelpMessage('Generates new config for Magallanes. For now, only adding a environment is possible')
 | 
				
			||||||
 | 
					            ->setSyntaxMessage('mage add [environment] [--name=env_name] [--enableReleases]')
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage add environment --name=production',
 | 
				
			||||||
 | 
					                'Add a production environment'
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage add environment --name=qa --enableReleases',
 | 
				
			||||||
 | 
					                'Add a QA environment and enable releasing'
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Adds new Configuration Elements
 | 
					     * Adds new Configuration Elements
 | 
				
			||||||
     * @see \Mage\Command\AbstractCommand::run()
 | 
					     * @see \Mage\Command\AbstractCommand::run()
 | 
				
			||||||
 | 
				
			|||||||
@ -21,6 +21,13 @@ use Mage\Compiler;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
class CompileCommand extends AbstractCommand
 | 
					class CompileCommand extends AbstractCommand
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    public function __construct()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->setName('Compile command')
 | 
				
			||||||
 | 
					            ->setHelpMessage('Compiles Magallanes to mage.phar file')
 | 
				
			||||||
 | 
					            ->setSyntaxMessage('mage compile');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * @var Compiler
 | 
					     * @var Compiler
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
 | 
				
			|||||||
@ -103,6 +103,22 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    protected static $failedTasks = 0;
 | 
					    protected static $failedTasks = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function __construct()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->setName('Deploy command')
 | 
				
			||||||
 | 
					            ->setHelpMessage('Deploys the project into target environment')
 | 
				
			||||||
 | 
					            ->setSyntaxMessage('mage deploy to:[environment_name]')
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage deploy to:production',
 | 
				
			||||||
 | 
					                'Deploy the project into <bold>production</bold> environment'
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage deploy to:production --overrideRelease',
 | 
				
			||||||
 | 
					                'Deploy the project into <bold>production</bold> environment '
 | 
				
			||||||
 | 
					                . 'but skip <bold>SkipOnOverride</bold> aware tasks'
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Returns the Status of the Deployment
 | 
					     * Returns the Status of the Deployment
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
 | 
				
			|||||||
@ -20,6 +20,20 @@ use Mage\Console;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
class InitCommand extends AbstractCommand
 | 
					class InitCommand extends AbstractCommand
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    public function __construct()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->setName('Initialize command')
 | 
				
			||||||
 | 
					            ->setHelpMessage('Initialize Magallanes project, create .mage directory with starter configs')
 | 
				
			||||||
 | 
					            ->setSyntaxMessage('mage init --name=[project_name] [--email=[author_email]]')
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage init --name="My awesome project"',
 | 
				
			||||||
 | 
					                'Initialize "My awesome project" configuration'
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage init --name="My project" --email="john.smith@example.com"',
 | 
				
			||||||
 | 
					                'Initialize "My project" configuration with email notification enabled for john.smith@example.com'
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Command for Initalize a new Configuration Proyect
 | 
					     * Command for Initalize a new Configuration Proyect
 | 
				
			||||||
 | 
				
			|||||||
@ -20,6 +20,24 @@ use Mage\Console;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
class InstallCommand extends AbstractCommand
 | 
					class InstallCommand extends AbstractCommand
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    public function __construct()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->setName('Install command')
 | 
				
			||||||
 | 
					            ->setHelpMessage(
 | 
				
			||||||
 | 
					                'Installs Magallanes system-widely.'
 | 
				
			||||||
 | 
					                . ' By default, Magallanes\' going to be installed in /opt/magallanes'
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            ->setSyntaxMessage('mage install [--installDir=[install_directory]] [--systemWide]')
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage install --installDir=/src/projects/Magellanes',
 | 
				
			||||||
 | 
					                'Install Magallanes at /src/projects/Magallanes directory'
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage install --systemWide',
 | 
				
			||||||
 | 
					                'Install Magallanes at default directory and creates a symlink in /usr/bin/mage'
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Installs Magallanes
 | 
					     * Installs Magallanes
 | 
				
			||||||
     * @see \Mage\Command\AbstractCommand::run()
 | 
					     * @see \Mage\Command\AbstractCommand::run()
 | 
				
			||||||
 | 
				
			|||||||
@ -23,6 +23,17 @@ use Exception;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
class ListCommand extends AbstractCommand
 | 
					class ListCommand extends AbstractCommand
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    public function __construct()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->setName('List command')
 | 
				
			||||||
 | 
					            ->setHelpMessage('List available configurations. For now, only environments listing available')
 | 
				
			||||||
 | 
					            ->setSyntaxMessage('mage list [environments]')
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage list environments',
 | 
				
			||||||
 | 
					                'List currently configured environments'
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Command for Listing Configuration Elements
 | 
					     * Command for Listing Configuration Elements
 | 
				
			||||||
     * @see \Mage\Command\AbstractCommand::run()
 | 
					     * @see \Mage\Command\AbstractCommand::run()
 | 
				
			||||||
 | 
				
			|||||||
@ -21,6 +21,21 @@ use Mage\Console;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
class LockCommand extends AbstractCommand implements RequiresEnvironment
 | 
					class LockCommand extends AbstractCommand implements RequiresEnvironment
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    public function __construct()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->setName('Lock command')
 | 
				
			||||||
 | 
					            ->setHelpMessage(
 | 
				
			||||||
 | 
					                "Locks the deployment to given environment and creates a lock file "
 | 
				
			||||||
 | 
					                . "with lock reason and lock performer.\n"
 | 
				
			||||||
 | 
					                . "You are going to be prompted to provide this information"
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            ->setSyntaxMessage('mage lock to:[environment_name]')
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage lock to:production',
 | 
				
			||||||
 | 
					                'Create a lock to production environment deployment'
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Locks the Deployment to a Environment
 | 
					     * Locks the Deployment to a Environment
 | 
				
			||||||
     * @see \Mage\Command\AbstractCommand::run()
 | 
					     * @see \Mage\Command\AbstractCommand::run()
 | 
				
			||||||
 | 
				
			|||||||
@ -22,6 +22,36 @@ use Mage\Console;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
class ReleasesCommand extends AbstractCommand implements RequiresEnvironment
 | 
					class ReleasesCommand extends AbstractCommand implements RequiresEnvironment
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    public function __construct()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->setName('Releases management command')
 | 
				
			||||||
 | 
					            ->setHelpMessage('Manages releases')
 | 
				
			||||||
 | 
					            ->setSyntaxMessage(
 | 
				
			||||||
 | 
					                'mage releases [list|rollback [--release=[release_id]]] '
 | 
				
			||||||
 | 
					                . 'to:[environment_name] [--deleteCurrent]'
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage releases list to:production',
 | 
				
			||||||
 | 
					                'List releases on production environment'
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage releases rollback --release=20120101172148 to:production',
 | 
				
			||||||
 | 
					                'Rollback 20120101172148 release on production environment'
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage releases rollback --release=-1 to:production',
 | 
				
			||||||
 | 
					                'Rollback <bold>list release -1</bold> release on production environment'
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage releases rollback --release=0 to:production',
 | 
				
			||||||
 | 
					                'Rollback last release on production environment'
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage releases rollback -1 to:production --deleteCurrent',
 | 
				
			||||||
 | 
					                'Rollbacks the <bold>last release -1</bold> release and removes current release'
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * List the Releases, Rollback to a Release
 | 
					     * List the Releases, Rollback to a Release
 | 
				
			||||||
     * @see \Mage\Command\AbstractCommand::run()
 | 
					     * @see \Mage\Command\AbstractCommand::run()
 | 
				
			||||||
 | 
				
			|||||||
@ -22,6 +22,24 @@ use Mage\Console;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
class RollbackCommand extends AbstractCommand implements RequiresEnvironment
 | 
					class RollbackCommand extends AbstractCommand implements RequiresEnvironment
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    public function __construct()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->setName('Rollback command')
 | 
				
			||||||
 | 
					            ->setHelpMessage('Rollbacks the release by given release id or index')
 | 
				
			||||||
 | 
					            ->setSyntaxMessage('mage rollback [releaseId] to:[environment_name]')
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage rollback 20120101172148 to:production',
 | 
				
			||||||
 | 
					                'Rollbacks the 20120101172148 release on production environment'
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage rollback -1 to:production',
 | 
				
			||||||
 | 
					                'Rollbacks the <bold>last release -1</bold> release'
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage rollback -1 to:production --deleteCurrent',
 | 
				
			||||||
 | 
					                'Rollbacks the <bold>last release -1</bold> release and removes current release'
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Rollback a release
 | 
					     * Rollback a release
 | 
				
			||||||
     * @see \Mage\Command\AbstractCommand::run()
 | 
					     * @see \Mage\Command\AbstractCommand::run()
 | 
				
			||||||
 | 
				
			|||||||
@ -21,6 +21,17 @@ use Mage\Console;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
class UnlockCommand extends AbstractCommand implements RequiresEnvironment
 | 
					class UnlockCommand extends AbstractCommand implements RequiresEnvironment
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    public function __construct()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->setName('Unlock command')
 | 
				
			||||||
 | 
					            ->setHelpMessage('Unlocks deployment for given environment')
 | 
				
			||||||
 | 
					            ->setSyntaxMessage('mage unlock to:[environment_name]')
 | 
				
			||||||
 | 
					            ->addUsageExample(
 | 
				
			||||||
 | 
					                'mage unlock to:production',
 | 
				
			||||||
 | 
					                'Removes the lock form production environment deployment'
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Unlocks an Environment
 | 
					     * Unlocks an Environment
 | 
				
			||||||
     * @see \Mage\Command\AbstractCommand::run()
 | 
					     * @see \Mage\Command\AbstractCommand::run()
 | 
				
			||||||
 | 
				
			|||||||
@ -21,6 +21,13 @@ use Mage\Console;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
class UpdateCommand extends AbstractCommand
 | 
					class UpdateCommand extends AbstractCommand
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    public function __construct()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->setName('Update command')
 | 
				
			||||||
 | 
					            ->setHelpMessage('Updates the SCM base code')
 | 
				
			||||||
 | 
					            ->setSyntaxMessage('mage update');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Updates the SCM Base Code
 | 
					     * Updates the SCM Base Code
 | 
				
			||||||
     * @see \Mage\Command\AbstractCommand::run()
 | 
					     * @see \Mage\Command\AbstractCommand::run()
 | 
				
			||||||
 | 
				
			|||||||
@ -20,6 +20,13 @@ use Mage\Console;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
class UpgradeCommand extends AbstractCommand
 | 
					class UpgradeCommand extends AbstractCommand
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    public function __construct()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->setName('Upgrade command')
 | 
				
			||||||
 | 
					            ->setHelpMessage('Upgrades Magallanes')
 | 
				
			||||||
 | 
					            ->setSyntaxMessage('mage upgrade');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Source for downloading
 | 
					     * Source for downloading
 | 
				
			||||||
     * @var string
 | 
					     * @var string
 | 
				
			||||||
 | 
				
			|||||||
@ -20,6 +20,12 @@ use Mage\Console;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
class VersionCommand extends AbstractCommand
 | 
					class VersionCommand extends AbstractCommand
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    public function __construct()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->setName('Version command')
 | 
				
			||||||
 | 
					            ->setHelpMessage('Displays the current version of Magallanes')
 | 
				
			||||||
 | 
					            ->setSyntaxMessage('mage version');
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Display the Magallanes Version
 | 
					     * Display the Magallanes Version
 | 
				
			||||||
     * @see \Mage\Command\AbstractCommand::run()
 | 
					     * @see \Mage\Command\AbstractCommand::run()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user