From 304087a24d7e8dcef897f6a1229e6773c49f2abe Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 31 Mar 2023 16:47:27 +0200 Subject: [PATCH] fix again --- app/Jobs/DeployApplicationJob.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/Jobs/DeployApplicationJob.php b/app/Jobs/DeployApplicationJob.php index 23834bec0..647fb1ff1 100644 --- a/app/Jobs/DeployApplicationJob.php +++ b/app/Jobs/DeployApplicationJob.php @@ -117,7 +117,9 @@ public function handle(): void $this->executeNow([ "echo -n 'Generating nixpacks configuration... '", - $this->getNixpacks(), + $this->nixpacks_build_cmd(), + $this->execute_in_builder("cp {$this->workdir}/.nixpacks/Dockerfile {$this->workdir}/Dockerfile"), + $this->execute_in_builder("rm -f {$this->workdir}/.nixpacks/Dockerfile"), "echo 'Done.'", "echo -n 'Building image... '", $this->execute_in_builder("docker build -f {$this->workdir}/Dockerfile --build-arg SOURCE_COMMIT={$this->git_commit} --progress plain -t {$this->application->uuid}:{$this->git_commit} {$this->workdir}"), @@ -281,7 +283,7 @@ private function gitImport() } } } - private function getNixpacks() + private function nixpacks_build_cmd() { if (str_starts_with($this->application->base_image, 'apache') || str_starts_with($this->application->base_image, 'nginx')) { // @TODO: Add static site builds @@ -297,10 +299,7 @@ private function getNixpacks() $nixpacks_command .= " --start-cmd '{$this->application->start_command}'"; } $nixpacks_command .= " {$this->workdir}"; - $command_other_command[] = $this->execute_in_builder($nixpacks_command); - $command_other_command[] = $this->execute_in_builder("cp {$this->workdir}/.nixpacks/Dockerfile {$this->workdir}/Dockerfile"); - $command_other_command[] = $this->execute_in_builder("rm -f {$this->workdir}/.nixpacks/Dockerfile"); } - return $command_other_command; + return $this->execute_in_builder($nixpacks_command); } }