From 407f84a4bbf31a2fc04db7ac80f7f285e480b5be Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 26 Feb 2024 14:28:02 +0100 Subject: [PATCH] Refactor Dockerfile location handling in ApplicationDeploymentJob.php --- app/Jobs/ApplicationDeploymentJob.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index aa4324f39..bc4b655b3 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -118,10 +118,6 @@ public function __construct(int $application_deployment_queue_id) $this->restart_only = $this->application_deployment_queue->restart_only; $this->only_this_server = $this->application_deployment_queue->only_this_server; - if (data_get($this->application, 'dockerfile_location')) { - $this->dockerfile_location = $this->application->dockerfile_location; - } - $this->git_type = data_get($this->application_deployment_queue, 'git_type'); $source = data_get($this->application, 'source'); @@ -171,6 +167,11 @@ public function __construct(int $application_deployment_queue_id) if ($this->application->is_github_based()) { ApplicationPullRequestUpdateJob::dispatch(application: $this->application, preview: $this->preview, deployment_uuid: $this->deployment_uuid, status: ProcessStatus::IN_PROGRESS); } + if ($this->application->build_pack === 'dockerfile') { + if (data_get($this->application, 'dockerfile_location')) { + $this->dockerfile_location = $this->application->dockerfile_location; + } + } } } @@ -429,6 +430,9 @@ private function deploy_dockerfile_buildpack() if ($this->use_build_server) { $this->server = $this->build_server; } + if (data_get($this->application, 'dockerfile_location')) { + $this->dockerfile_location = $this->application->dockerfile_location; + } $this->application_deployment_queue->addLogEntry("Starting deployment of {$this->customRepository}:{$this->application->git_branch} to {$this->server->name}."); $this->prepare_builder_image(); $this->check_git_if_build_needed();