fix(deployment): prevent removal of running containers for pull request deployments in case of failure
This commit is contained in:
parent
65a50f2112
commit
b34dc11d8e
1 changed files with 2 additions and 2 deletions
|
|
@ -2979,8 +2979,8 @@ public function failed(Throwable $exception): void
|
||||||
$code = $exception->getCode();
|
$code = $exception->getCode();
|
||||||
if ($code !== 69420) {
|
if ($code !== 69420) {
|
||||||
// 69420 means failed to push the image to the registry, so we don't need to remove the new version as it is the currently running one
|
// 69420 means failed to push the image to the registry, so we don't need to remove the new version as it is the currently running one
|
||||||
if ($this->application->settings->is_consistent_container_name_enabled || str($this->application->settings->custom_internal_name)->isNotEmpty()) {
|
if ($this->application->settings->is_consistent_container_name_enabled || str($this->application->settings->custom_internal_name)->isNotEmpty() || $this->pull_request_id !== 0) {
|
||||||
// do not remove already running container
|
// do not remove already running container for PR deployments
|
||||||
} else {
|
} else {
|
||||||
$this->application_deployment_queue->addLogEntry('Deployment failed. Removing the new version of your application.', 'stderr');
|
$this->application_deployment_queue->addLogEntry('Deployment failed. Removing the new version of your application.', 'stderr');
|
||||||
$this->execute_remote_command(
|
$this->execute_remote_command(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue