Pantheon\Terminus\Commands\Env\DeployCommand::deploy PHP Method

deploy() public method

Deploy the dev environment to either test or live
public deploy ( string $site_env, $options = ['sync-content' => false, 'note' => 'Deploy from Terminus', 'cc' => false, 'updatedb' => false] )
$site_env string Site & environment to deploy to, in the form `site-name.env`
    public function deploy($site_env, $options = ['sync-content' => false, 'note' => 'Deploy from Terminus', 'cc' => false, 'updatedb' => false])
    {
        list(, $env) = $this->getSiteEnv($site_env, 'dev');
        if ($env->isInitialized()) {
            if (!$env->hasDeployableCode()) {
                $this->log()->notice('There is nothing to deploy.');
                return;
            }
            $params = ['updatedb' => (int) $options['updatedb'], 'clear_cache' => (int) $options['cc'], 'annotation' => $options['note']];
            if ($env->id == 'test' && isset($options['sync-content']) && $options['sync-content']) {
                $params['clone_database'] = ['from_environment' => 'live'];
                $params['clone_files'] = ['from_environment' => 'live'];
            }
            $workflow = $env->deploy($params);
        } else {
            $workflow = $env->initializeBindings();
        }
        while (!$workflow->checkProgress()) {
            // @TODO: Add Symfony progress bar to indicate that something is happening.
        }
        $this->log()->notice($workflow->getMessage());
    }
DeployCommand