fail the job manually

This commit is contained in:
Andras Bacsai
2023-05-03 11:30:58 +02:00
parent 59d69587dd
commit 906b4ce158

View File

@@ -222,10 +222,10 @@ COPY --from={$this->application->uuid}:{$this->git_commit}-build /app/{$this->ap
Storage::disk('deployments')->put(Str::kebab($this->application->name) . '/docker-compose.yml', $this->docker_compose); Storage::disk('deployments')->put(Str::kebab($this->application->name) . '/docker-compose.yml', $this->docker_compose);
} catch (\Exception $e) { } catch (\Exception $e) {
$this->executeNow([ $this->executeNow([
"echo 'Oops something is not okay, are you okay? 😢'", "echo '\nOops something is not okay, are you okay? 😢'",
"echo '\n\n{$e->getMessage()}'", "echo '\n\n{$e->getMessage()}'",
]); ]);
throw new \Exception('Deployment finished'); $this->fail($e->getMessage());
} finally { } finally {
$this->executeNow(["docker rm -f {$this->deployment_uuid} >/dev/null 2>&1"], hideFromOutput: true); $this->executeNow(["docker rm -f {$this->deployment_uuid} >/dev/null 2>&1"], hideFromOutput: true);
dispatch(new ContainerStatusJob($this->application_uuid)); dispatch(new ContainerStatusJob($this->application_uuid));