fix: labelling

This commit is contained in:
Andras Bacsai
2023-12-12 15:48:51 +01:00
parent 4bc63e283c
commit f042c70b3c
5 changed files with 28 additions and 15 deletions

View File

@@ -267,7 +267,7 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
"ignore_errors" => true,
]
);
ApplicationStatusChanged::dispatch(data_get($this->application,'environment.project.team.id'));
ApplicationStatusChanged::dispatch(data_get($this->application, 'environment.project.team.id'));
}
}
private function push_to_docker_registry()
@@ -874,6 +874,15 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
$environment_variables = $this->generate_environment_variables($ports);
if (data_get($this->application, 'custom_labels')) {
if (base64_encode(base64_decode(data_get($this->application, 'custom_labels'), true)) === data_get($this->application, 'custom_labels')) {
ray('custom_labels is base64 encoded');
} else {
ray('custom_labels is not base64 encoded');
$this->application->custom_labels = str($this->application->custom_labels)->replace(',', "\n");
$this->application->custom_labels = base64_encode(data_get($this->application, 'custom_labels'));
$this->application->save();
}
$labels = collect(preg_split("/\r\n|\n|\r/", base64_decode($this->application->custom_labels)));
$labels = $labels->filter(function ($value, $key) {
return !Str::startsWith($value, 'coolify.');
@@ -1247,7 +1256,8 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
}
}
private function build_by_compose_file() {
private function build_by_compose_file()
{
$this->application_deployment_queue->addLogEntry("Pulling & building required images.");
if ($this->application->build_pack === 'dockerimage') {
$this->application_deployment_queue->addLogEntry("Pulling latest images from the registry.");