feat: able to deploy without cache on every commit
This commit is contained in:
@@ -140,6 +140,8 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
|
|||||||
|
|
||||||
private ?string $buildTarget = null;
|
private ?string $buildTarget = null;
|
||||||
|
|
||||||
|
private bool $disableBuildCache = false;
|
||||||
|
|
||||||
private Collection $saved_outputs;
|
private Collection $saved_outputs;
|
||||||
|
|
||||||
private ?string $full_healthcheck_url = null;
|
private ?string $full_healthcheck_url = null;
|
||||||
@@ -178,7 +180,11 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
|
|||||||
$this->pull_request_id = $this->application_deployment_queue->pull_request_id;
|
$this->pull_request_id = $this->application_deployment_queue->pull_request_id;
|
||||||
$this->commit = $this->application_deployment_queue->commit;
|
$this->commit = $this->application_deployment_queue->commit;
|
||||||
$this->rollback = $this->application_deployment_queue->rollback;
|
$this->rollback = $this->application_deployment_queue->rollback;
|
||||||
|
$this->disableBuildCache = $this->application->settings->disable_build_cache;
|
||||||
$this->force_rebuild = $this->application_deployment_queue->force_rebuild;
|
$this->force_rebuild = $this->application_deployment_queue->force_rebuild;
|
||||||
|
if ($this->disableBuildCache) {
|
||||||
|
$this->force_rebuild = true;
|
||||||
|
}
|
||||||
$this->restart_only = $this->application_deployment_queue->restart_only;
|
$this->restart_only = $this->application_deployment_queue->restart_only;
|
||||||
$this->restart_only = $this->restart_only && $this->application->build_pack !== 'dockerimage' && $this->application->build_pack !== 'dockerfile';
|
$this->restart_only = $this->restart_only && $this->application->build_pack !== 'dockerimage' && $this->application->build_pack !== 'dockerfile';
|
||||||
$this->only_this_server = $this->application_deployment_queue->only_this_server;
|
$this->only_this_server = $this->application_deployment_queue->only_this_server;
|
||||||
@@ -1976,6 +1982,9 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
|
|||||||
$this->build_args = $this->build_args->implode(' ');
|
$this->build_args = $this->build_args->implode(' ');
|
||||||
|
|
||||||
$this->application_deployment_queue->addLogEntry('----------------------------------------');
|
$this->application_deployment_queue->addLogEntry('----------------------------------------');
|
||||||
|
if ($this->disableBuildCache) {
|
||||||
|
$this->application_deployment_queue->addLogEntry('Docker build cache is disabled. It will not be used during the build process.');
|
||||||
|
}
|
||||||
if ($this->application->build_pack === 'static') {
|
if ($this->application->build_pack === 'static') {
|
||||||
$this->application_deployment_queue->addLogEntry('Static deployment. Copying static assets to the image.');
|
$this->application_deployment_queue->addLogEntry('Static deployment. Copying static assets to the image.');
|
||||||
} else {
|
} else {
|
||||||
|
@@ -25,6 +25,9 @@ class Advanced extends Component
|
|||||||
#[Validate(['boolean'])]
|
#[Validate(['boolean'])]
|
||||||
public bool $isAutoDeployEnabled = true;
|
public bool $isAutoDeployEnabled = true;
|
||||||
|
|
||||||
|
#[Validate(['boolean'])]
|
||||||
|
public bool $disableBuildCache = false;
|
||||||
|
|
||||||
#[Validate(['boolean'])]
|
#[Validate(['boolean'])]
|
||||||
public bool $isLogDrainEnabled = false;
|
public bool $isLogDrainEnabled = false;
|
||||||
|
|
||||||
@@ -95,6 +98,7 @@ class Advanced extends Component
|
|||||||
$this->application->settings->is_stripprefix_enabled = $this->isStripprefixEnabled;
|
$this->application->settings->is_stripprefix_enabled = $this->isStripprefixEnabled;
|
||||||
$this->application->settings->is_raw_compose_deployment_enabled = $this->isRawComposeDeploymentEnabled;
|
$this->application->settings->is_raw_compose_deployment_enabled = $this->isRawComposeDeploymentEnabled;
|
||||||
$this->application->settings->connect_to_docker_network = $this->isConnectToDockerNetworkEnabled;
|
$this->application->settings->connect_to_docker_network = $this->isConnectToDockerNetworkEnabled;
|
||||||
|
$this->application->settings->disable_build_cache = $this->disableBuildCache;
|
||||||
$this->application->settings->save();
|
$this->application->settings->save();
|
||||||
} else {
|
} else {
|
||||||
$this->isForceHttpsEnabled = $this->application->isForceHttpsEnabled();
|
$this->isForceHttpsEnabled = $this->application->isForceHttpsEnabled();
|
||||||
@@ -116,6 +120,7 @@ class Advanced extends Component
|
|||||||
$this->customInternalName = $this->application->settings->custom_internal_name;
|
$this->customInternalName = $this->application->settings->custom_internal_name;
|
||||||
$this->isRawComposeDeploymentEnabled = $this->application->settings->is_raw_compose_deployment_enabled;
|
$this->isRawComposeDeploymentEnabled = $this->application->settings->is_raw_compose_deployment_enabled;
|
||||||
$this->isConnectToDockerNetworkEnabled = $this->application->settings->connect_to_docker_network;
|
$this->isConnectToDockerNetworkEnabled = $this->application->settings->connect_to_docker_network;
|
||||||
|
$this->disableBuildCache = $this->application->settings->disable_build_cache;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -288,9 +288,9 @@ function fqdnLabelsForCaddy(string $network, string $uuid, Collection $domains,
|
|||||||
$host_without_www = str($host)->replace('www.', '');
|
$host_without_www = str($host)->replace('www.', '');
|
||||||
$schema = $url->getScheme();
|
$schema = $url->getScheme();
|
||||||
$port = $url->getPort();
|
$port = $url->getPort();
|
||||||
$handle = "handle_path";
|
$handle = 'handle_path';
|
||||||
if (! $is_stripprefix_enabled) {
|
if (! $is_stripprefix_enabled) {
|
||||||
$handle = "handle";
|
$handle = 'handle';
|
||||||
}
|
}
|
||||||
if (is_null($port) && ! is_null($onlyPort)) {
|
if (is_null($port) && ! is_null($onlyPort)) {
|
||||||
$port = $onlyPort;
|
$port = $onlyPort;
|
||||||
@@ -302,7 +302,6 @@ function fqdnLabelsForCaddy(string $network, string $uuid, Collection $domains,
|
|||||||
$labels->push("caddy_{$loop}.header=-Server");
|
$labels->push("caddy_{$loop}.header=-Server");
|
||||||
$labels->push("caddy_{$loop}.try_files={path} /index.html /index.php");
|
$labels->push("caddy_{$loop}.try_files={path} /index.html /index.php");
|
||||||
|
|
||||||
|
|
||||||
if ($port) {
|
if ($port) {
|
||||||
$labels->push("caddy_{$loop}.{$handle}.{$loop}_reverse_proxy={{upstreams $port}}");
|
$labels->push("caddy_{$loop}.{$handle}.{$loop}_reverse_proxy={{upstreams $port}}");
|
||||||
} else {
|
} else {
|
||||||
|
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('application_settings', function (Blueprint $table) {
|
||||||
|
$table->boolean('disable_build_cache')->default(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('application_settings', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('disable_build_cache');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
@@ -13,6 +13,8 @@
|
|||||||
helper="Allow to automatically deploy Preview Deployments for all opened PR's.<br><br>Closing a PR will delete Preview Deployments."
|
helper="Allow to automatically deploy Preview Deployments for all opened PR's.<br><br>Closing a PR will delete Preview Deployments."
|
||||||
instantSave id="isPreviewDeploymentsEnabled" label="Preview Deployments" />
|
instantSave id="isPreviewDeploymentsEnabled" label="Preview Deployments" />
|
||||||
@endif
|
@endif
|
||||||
|
<x-forms.checkbox helper="Disable Docker build cache on every deployment." instantSave id="disableBuildCache"
|
||||||
|
label="Disable Build Cache" />
|
||||||
<x-forms.checkbox
|
<x-forms.checkbox
|
||||||
helper="Your application will be available only on https if your domain starts with https://..."
|
helper="Your application will be available only on https if your domain starts with https://..."
|
||||||
instantSave id="isForceHttpsEnabled" label="Force Https" />
|
instantSave id="isForceHttpsEnabled" label="Force Https" />
|
||||||
|
Reference in New Issue
Block a user