Skip to content

Commit

Permalink
Merge pull request #4910 from coollabsio/next
Browse files Browse the repository at this point in the history
v4.0.0-beta.386
  • Loading branch information
andrasbacsai authored Jan 22, 2025
2 parents 0d64767 + 5edcc69 commit 0ab9130
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 11 deletions.
21 changes: 14 additions & 7 deletions bootstrap/helpers/shared.php
Original file line number Diff line number Diff line change
Expand Up @@ -2645,15 +2645,17 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
if ($value?->startsWith('$')) {
$foundEnv = EnvironmentVariable::where([
'key' => $key,
'application_id' => $resource->id,
'resourceable_type' => get_class($resource),
'resourceable_id' => $resource->id,
'is_preview' => false,
])->first();
$value = replaceVariables($value);
$key = $value;
if ($value->startsWith('SERVICE_')) {
$foundEnv = EnvironmentVariable::where([
'key' => $key,
'application_id' => $resource->id,
'resourceable_type' => get_class($resource),
'resourceable_id' => $resource->id,
])->first();
['command' => $command, 'forService' => $forService, 'generatedValue' => $generatedValue, 'port' => $port] = parseEnvVariable($value);
if (! is_null($command)) {
Expand All @@ -2676,7 +2678,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
'key' => $key,
'value' => $fqdn,
'is_build_time' => false,
'application_id' => $resource->id,
'resourceable_type' => get_class($resource),
'resourceable_id' => $resource->id,
'is_preview' => false,
]);
}
Expand All @@ -2687,7 +2690,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
'key' => $key,
'value' => $generatedValue,
'is_build_time' => false,
'application_id' => $resource->id,
'resourceable_type' => get_class($resource),
'resourceable_id' => $resource->id,
'is_preview' => false,
]);
}
Expand All @@ -2712,7 +2716,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
}
$foundEnv = EnvironmentVariable::where([
'key' => $key,
'application_id' => $resource->id,
'resourceable_type' => get_class($resource),
'resourceable_id' => $resource->id,
'is_preview' => false,
])->first();
if ($foundEnv) {
Expand All @@ -2722,7 +2727,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
if ($foundEnv) {
$foundEnv->update([
'key' => $key,
'application_id' => $resource->id,
'resourceable_type' => get_class($resource),
'resourceable_id' => $resource->id,
'is_build_time' => $isBuildTime,
'value' => $defaultValue,
]);
Expand All @@ -2731,7 +2737,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
'key' => $key,
'value' => $defaultValue,
'is_build_time' => $isBuildTime,
'application_id' => $resource->id,
'resourceable_type' => get_class($resource),
'resourceable_id' => $resource->id,
'is_preview' => false,
]);
}
Expand Down
2 changes: 1 addition & 1 deletion config/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

return [
'coolify' => [
'version' => '4.0.0-beta.385',
'version' => '4.0.0-beta.386',
'self_hosted' => env('SELF_HOSTED', true),
'autoupdate' => env('AUTOUPDATE'),
'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

use App\Models\EnvironmentVariable;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Log;

return new class extends Migration
{
public function up(): void
{
try {
EnvironmentVariable::whereNull('resourceable_id')->each(function (EnvironmentVariable $environmentVariable) {
$environmentVariable->delete();
});
} catch (\Exception $e) {
Log::error('Failed to delete wrongly created environment variables: '.$e->getMessage());
}
}
};
2 changes: 1 addition & 1 deletion docker/coolify-helper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ARG DOCKER_BUILDX_VERSION=0.19.3
# https://github.com/buildpacks/pack/releases
ARG PACK_VERSION=0.36.2
# https://github.com/railwayapp/nixpacks/releases
ARG NIXPACKS_VERSION=1.30.0
ARG NIXPACKS_VERSION=1.32.0
# https://github.com/minio/mc/releases
ARG MINIO_VERSION=RELEASE.2024-11-21T17-21-54Z

Expand Down
4 changes: 2 additions & 2 deletions versions.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"coolify": {
"v4": {
"version": "4.0.0-beta.385"
"version": "4.0.0-beta.386"
},
"nightly": {
"version": "4.0.0-beta.386"
"version": "4.0.0-beta.387"
},
"helper": {
"version": "1.0.4"
Expand Down

0 comments on commit 0ab9130

Please sign in to comment.