From 0aa91b977df769ad297e4766bb1596e524e78bae Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 29 Mar 2023 18:09:16 +0200 Subject: [PATCH] base64 decode data --- app/Http/Livewire/DeployApplication.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Livewire/DeployApplication.php b/app/Http/Livewire/DeployApplication.php index 66c79ebef..c340a9aa7 100644 --- a/app/Http/Livewire/DeployApplication.php +++ b/app/Http/Livewire/DeployApplication.php @@ -59,7 +59,7 @@ public function deploy() $workdir = "/artifacts/{$this->deployment_uuid}"; // Start build process - $docker_compose = $this->generate_docker_compose($application); + $docker_compose_base64 = base64_encode($this->generate_docker_compose($application)); $this->command[] = "echo 'Starting deployment of {$application->name} ({$application->uuid})'"; $this->start_builder_container(); $this->execute_in_builder("git clone -b {$application->git_branch} {$source->html_url}/{$application->git_repository}.git {$workdir}"); @@ -68,7 +68,7 @@ public function deploy() $this->execute_in_builder("cd {$workdir} && git rev-parse HEAD > {$workdir}/.git-commit"); // Set TAG in docker-compose.yml - $this->execute_in_builder("echo -e '{$docker_compose}' > {$workdir}/docker-compose.yml"); + $this->execute_in_builder("echo '{$docker_compose_base64}' | base64 -d > {$workdir}/docker-compose.yml"); $this->execute_in_builder("sed -i \"s/TAG/$(cat {$workdir}/.git-commit)/g\" {$workdir}/docker-compose.yml"); $this->execute_in_builder("cat {$workdir}/docker-compose.yml");