/** * Executes the task. * * @param PayloadInterface|DeploymentPayload $payload * * @return null|int The exit status code */ public function run(PayloadInterface $payload) { $command = $this->getOption('command'); $cwd = $this->getOption('cwd', '/'); if ($payload->isDryRun()) { return 0; } return $this->exec($command, $cwd); }
/** * Executes the task. * * @param PayloadInterface|DeploymentPayload $payload * * @return null|int The exit status code */ public function run(PayloadInterface $payload) { $command = $this->getOption('command'); $timeout = $this->getOption('timeout', 60); $cwd = $this->getOption('cwd', $payload->getProjectDirectory()); if ($payload->isDryRun()) { return 0; } return $this->exec($command, $cwd, $timeout)->getExitCode(); }