Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: multiline build args

Andras Bacsai2e4fd1530cc5
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php
index 35d6aad0af..fa362875f4 100644
--- a/app/Jobs/ApplicationDeploymentJob.php
+++ b/app/Jobs/ApplicationDeploymentJob.php
@@ -244,13 +244,13 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
} else {
$this->write_deployment_configurations();
}
- $this->execute_remote_command(
- [
- "docker rm -f {$this->deployment_uuid} >/dev/null 2>&1",
- "hidden" => true,
- "ignore_errors" => true,
- ]
- );
+ // $this->execute_remote_command(
+ // [
+ // "docker rm -f {$this->deployment_uuid} >/dev/null 2>&1",
+ // "hidden" => true,
+ // "ignore_errors" => true,
+ // ]
+ // );
// $this->execute_remote_command(
@@ -1949,22 +1949,17 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
if ($this->pull_request_id === 0) {
foreach ($this->application->build_environment_variables as $env) {
$value = escapeshellarg($env->real_value);
- if (str($value)->contains("\n") && data_get($env, 'is_multiline') === true) {
- $value = str_replace("\n", "\\\n", $value);
- }
$this->build_args->push("--build-arg {$env->key}={$value}");
}
} else {
foreach ($this->application->build_environment_variables_preview as $env) {
$value = escapeshellarg($env->real_value);
- if (str($value)->contains("\n") && data_get($env, 'is_multiline') === true) {
- $value = str_replace("\n", "\\\n", $value);
- }
$this->build_args->push("--build-arg {$env->key}={$value}");
}
}
$this->build_args = $this->build_args->implode(' ');
+ ray($this->build_args);
}
private function add_build_env_variables_to_dockerfile()
@@ -1975,19 +1970,18 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
$dockerfile = collect(Str::of($this->saved_outputs->get('dockerfile'))->trim()->explode("\n"));
if ($this->pull_request_id === 0) {
foreach ($this->application->build_environment_variables as $env) {
- if (str($env->real_value)->contains("\n") && data_get($env, 'is_multiline') === true) {
- $value = str_replace("\n", "\\\n", $env->real_value);
+ if (data_get($env, 'is_multiline') === true) {
+ $dockerfile->splice(1, 0, "ARG {$env->key}");
} else {
- $value = $env->real_value;
+ $dockerfile->splice(1, 0, "ARG {$env->key}={$env->real_value}");
}
- $dockerfile->splice(1, 0, "ARG {$env->key}={$value}");
}
} else {
foreach ($this->application->build_environment_variables_preview as $env) {
- if (str($env->real_value)->contains("\n") && data_get($env, 'is_multiline') === true) {
- $value = str_replace("\n", "\\\n", $env->real_value);
+ if (data_get($env, 'is_multiline') === true) {
+ $dockerfile->splice(1, 0, "ARG {$env->key}");
} else {
- $value = $env->real_value;
+ $dockerfile->splice(1, 0, "ARG {$env->key}={$env->real_value}");
}
$dockerfile->splice(1, 0, "ARG {$env->key}={$env->real_value}");
}