/** * Create an instance of DeployStep and a ServerLog entry for each server which can have code deployed. * * @param int $stage * @return void */ private function createDeployStep($stage) { $step = DeployStep::create(['stage' => $stage, 'deployment_id' => $this->deployment->id]); foreach ($this->project->servers as $server) { // If command is null it is preparing one of the 4 default steps so // skip servers which shouldn't have the code deployed if (!$server->deploy_code) { continue; } ServerLog::create(['server_id' => $server->id, 'deploy_step_id' => $step->id]); } }