Skip to content

Commit b68199a

Browse files
committed
fix: Fix issue with deployment start command in ApplicationDeploymentJob
1 parent 6f4436f commit b68199a

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

app/Jobs/ApplicationDeploymentJob.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,10 @@ private function deploy_docker_compose_buildpack()
490490
// Start compose file
491491
if ($this->application->settings->is_raw_compose_deployment_enabled) {
492492
if ($this->docker_compose_custom_start_command) {
493+
$this->write_deployment_configurations();
493494
$this->execute_remote_command(
494495
[executeInDocker($this->deployment_uuid, "cd {$this->workdir} && {$this->docker_compose_custom_start_command}"), 'hidden' => true],
495496
);
496-
$this->write_deployment_configurations();
497497
} else {
498498
$this->write_deployment_configurations();
499499
$server_workdir = $this->application->workdir();
@@ -510,22 +510,21 @@ private function deploy_docker_compose_buildpack()
510510
}
511511
} else {
512512
if ($this->docker_compose_custom_start_command) {
513+
$this->write_deployment_configurations();
513514
$this->execute_remote_command(
514515
[executeInDocker($this->deployment_uuid, "cd {$this->basedir} && {$this->docker_compose_custom_start_command}"), 'hidden' => true],
515516
);
516-
$this->write_deployment_configurations();
517517
} else {
518518
$command = "{$this->coolify_variables} docker compose";
519519
if ($this->env_filename) {
520520
$command .= " --env-file {$this->workdir}/{$this->env_filename}";
521521
}
522522
$command .= " --project-name {$this->application->uuid} --project-directory {$this->workdir} -f {$this->workdir}{$this->docker_compose_location} up -d";
523-
ray($command);
524523

524+
$this->write_deployment_configurations();
525525
$this->execute_remote_command(
526526
[executeInDocker($this->deployment_uuid, $command), 'hidden' => true],
527527
);
528-
$this->write_deployment_configurations();
529528
}
530529
}
531530

@@ -615,14 +614,14 @@ private function write_deployment_configurations()
615614
$this->server = $this->original_server;
616615
}
617616
if (str($this->configuration_dir)->isNotEmpty()) {
618-
ray("docker cp {$this->deployment_uuid}:{$this->workdir} {$this->configuration_dir}");
619617
$this->execute_remote_command(
620618
[
621619
"mkdir -p $this->configuration_dir",
622620
],
623-
[
624-
"rm -rf $this->configuration_dir/{*,.*}",
625-
],
621+
// removing this now as we are using docker cp
622+
// [
623+
// "rm -rf $this->configuration_dir/{*,.*}",
624+
// ],
626625
[
627626
"docker cp {$this->deployment_uuid}:{$this->workdir}/. {$this->configuration_dir}",
628627
],

0 commit comments

Comments
 (0)