DNDeployment::enqueueDeployment PHP Method

enqueueDeployment() public method

Start a resque job for this deployment
public enqueueDeployment ( ) : string
return string Resque token
    public function enqueueDeployment()
    {
        $environment = $this->Environment();
        $project = $environment->Project();
        $log = $this->log();
        $args = array('environmentName' => $environment->Name, 'repository' => $project->getLocalCVSPath(), 'logfile' => $this->logfile(), 'projectName' => $project->Name, 'env' => $project->getProcessEnv(), 'deploymentID' => $this->ID, 'sigFile' => $this->getSigFile());
        $strategy = $this->getDeploymentStrategy();
        // Inject options.
        $args = array_merge($args, $strategy->getOptions());
        // Make sure we use the SHA as it was written into this DNDeployment.
        $args['sha'] = $this->SHA;
        if (!$this->DeployerID) {
            $this->DeployerID = Member::currentUserID();
        }
        if ($this->DeployerID) {
            $deployer = $this->Deployer();
            $message = sprintf('Deploy to %s initiated by %s (%s), with IP address %s', $environment->getFullName(), $deployer->getName(), $deployer->Email, \Controller::curr()->getRequest()->getIP());
            $log->write($message);
        }
        return Resque::enqueue('deploy', 'DeployJob', $args, true);
    }