disable docker_compose deployments

This commit is contained in:
Andras Bacsai
2023-10-12 09:30:27 +02:00
parent 9318cac189
commit 972223f01b

View File

@@ -184,41 +184,42 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
} }
} }
private function deploy_docker_compose() // private function deploy_docker_compose()
{ // {
$dockercompose_base64 = base64_encode($this->application->dockercompose); // $dockercompose_base64 = base64_encode($this->application->dockercompose);
$this->execute_remote_command( // $this->execute_remote_command(
[ // [
"echo 'Starting deployment of {$this->application->name}.'" // "echo 'Starting deployment of {$this->application->name}.'"
], // ],
); // );
$this->prepare_builder_image(); // $this->prepare_builder_image();
$this->execute_remote_command( // $this->execute_remote_command(
[ // [
executeInDocker($this->deployment_uuid, "echo '$dockercompose_base64' | base64 -d > $this->workdir/docker-compose.yaml") // executeInDocker($this->deployment_uuid, "echo '$dockercompose_base64' | base64 -d > $this->workdir/docker-compose.yaml")
], // ],
); // );
$this->build_image_name = Str::lower("{$this->application->git_repository}:build"); // $this->build_image_name = Str::lower("{$this->application->git_repository}:build");
$this->production_image_name = Str::lower("{$this->application->uuid}:latest"); // $this->production_image_name = Str::lower("{$this->application->uuid}:latest");
$this->save_environment_variables(); // $this->save_environment_variables();
$containers = getCurrentApplicationContainerStatus($this->application->destination->server, $this->application->id); // $containers = getCurrentApplicationContainerStatus($this->application->destination->server, $this->application->id);
if ($containers->count() > 0) { // ray($containers);
foreach ($containers as $container) { // if ($containers->count() > 0) {
$containerName = data_get($container, 'Names'); // foreach ($containers as $container) {
if ($containerName) { // $containerName = data_get($container, 'Names');
instant_remote_process( // if ($containerName) {
["docker rm -f {$containerName}"], // instant_remote_process(
$this->application->destination->server // ["docker rm -f {$containerName}"],
); // $this->application->destination->server
} // );
} // }
} // }
// }
$this->execute_remote_command( // $this->execute_remote_command(
["echo -n 'Starting services (could take a while)...'"], // ["echo -n 'Starting services (could take a while)...'"],
[executeInDocker($this->deployment_uuid, "docker compose --project-directory {$this->workdir} up -d"), "hidden" => true], // [executeInDocker($this->deployment_uuid, "docker compose --project-directory {$this->workdir} up -d"), "hidden" => true],
); // );
} // }
private function save_environment_variables() private function save_environment_variables()
{ {
$envs = collect([]); $envs = collect([]);