From 2b64b9de63a5489164289780fe7a192677d1e20a Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 5 Apr 2024 15:33:11 +0200 Subject: [PATCH] fix: do not rebuild dockerfile based apps twice --- app/Jobs/ApplicationDeploymentJob.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 356006983..51c024af6 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -469,17 +469,17 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted $this->set_base_dir(); $this->generate_image_names(); $this->clone_repository(); - // if (!$this->force_rebuild) { - // $this->check_image_locally_or_remotely(); - // if (str($this->saved_outputs->get('local_image_found'))->isNotEmpty() && !$this->application->isConfigurationChanged()) { - // $this->create_workdir(); - // $this->application_deployment_queue->addLogEntry("No configuration changed & image found ({$this->production_image_name}) with the same Git Commit SHA. Build step skipped."); - // $this->generate_compose_file(); - // $this->push_to_docker_registry(); - // $this->rolling_update(); - // return; - // } - // } + if (!$this->force_rebuild) { + $this->check_image_locally_or_remotely(); + if (str($this->saved_outputs->get('local_image_found'))->isNotEmpty() && !$this->application->isConfigurationChanged()) { + $this->create_workdir(); + $this->application_deployment_queue->addLogEntry("No configuration changed & image found ({$this->production_image_name}) with the same Git Commit SHA. Build step skipped."); + $this->generate_compose_file(); + $this->push_to_docker_registry(); + $this->rolling_update(); + return; + } + } $this->cleanup_git(); $this->generate_compose_file(); $this->generate_build_env_variables();