From 132807b55d4a762dd117a201c66e58e6c3f092c4 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 2 Apr 2024 20:50:35 +0200 Subject: [PATCH] fix: always rebuild Dockerfile / dockerimage buildpacks --- app/Jobs/ApplicationDeploymentJob.php | 48 ++++++++++--------- .../application/deployment/show.blade.php | 2 +- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 0c6b6eecb..356006983 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -234,7 +234,7 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted $this->build_server = $this->server; $this->original_server = $this->server; } - if ($this->restart_only && $this->application->build_pack !== 'dockerimage') { + if ($this->restart_only && $this->application->build_pack !== 'dockerimage' && $this->application->build_pack !== 'dockerfile') { $this->just_restart(); if ($this->server->isProxyShouldRun()) { dispatch(new ContainerStatusJob($this->server)); @@ -326,17 +326,19 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted ], ); $this->generate_image_names(); - 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; - } - } + + // Always rebuild dockerfile based container. + // 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->generate_compose_file(); $this->generate_build_env_variables(); $this->add_build_env_variables_to_dockerfile(); @@ -467,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(); diff --git a/resources/views/livewire/project/application/deployment/show.blade.php b/resources/views/livewire/project/application/deployment/show.blade.php index 1426ef583..1d3455605 100644 --- a/resources/views/livewire/project/application/deployment/show.blade.php +++ b/resources/views/livewire/project/application/deployment/show.blade.php @@ -87,7 +87,7 @@
$line['hidden'], - 'text-red-500 whitespace-pre-line' => $line['type'] == 'stderr', + 'text-red-500 font-bold whitespace-pre-line' => $line['type'] == 'stderr', ])>[{{ $line['timestamp'] }}] @if ($line['hidden'])
COMMAND:
{{ $line['command'] }}

OUTPUT: @endif @if (str($line['output'])->contains('http://') || str($line['output'])->contains('https://'))