Merge pull request #4910 from coollabsio/next

v4.0.0-beta.386
This commit is contained in:
Andras Bacsai
2025-01-22 11:24:38 +01:00
committed by GitHub
5 changed files with 37 additions and 11 deletions

View File

@@ -2645,7 +2645,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
if ($value?->startsWith('$')) { if ($value?->startsWith('$')) {
$foundEnv = EnvironmentVariable::where([ $foundEnv = EnvironmentVariable::where([
'key' => $key, 'key' => $key,
'application_id' => $resource->id, 'resourceable_type' => get_class($resource),
'resourceable_id' => $resource->id,
'is_preview' => false, 'is_preview' => false,
])->first(); ])->first();
$value = replaceVariables($value); $value = replaceVariables($value);
@@ -2653,7 +2654,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
if ($value->startsWith('SERVICE_')) { if ($value->startsWith('SERVICE_')) {
$foundEnv = EnvironmentVariable::where([ $foundEnv = EnvironmentVariable::where([
'key' => $key, 'key' => $key,
'application_id' => $resource->id, 'resourceable_type' => get_class($resource),
'resourceable_id' => $resource->id,
])->first(); ])->first();
['command' => $command, 'forService' => $forService, 'generatedValue' => $generatedValue, 'port' => $port] = parseEnvVariable($value); ['command' => $command, 'forService' => $forService, 'generatedValue' => $generatedValue, 'port' => $port] = parseEnvVariable($value);
if (! is_null($command)) { if (! is_null($command)) {
@@ -2676,7 +2678,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
'key' => $key, 'key' => $key,
'value' => $fqdn, 'value' => $fqdn,
'is_build_time' => false, 'is_build_time' => false,
'application_id' => $resource->id, 'resourceable_type' => get_class($resource),
'resourceable_id' => $resource->id,
'is_preview' => false, 'is_preview' => false,
]); ]);
} }
@@ -2687,7 +2690,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
'key' => $key, 'key' => $key,
'value' => $generatedValue, 'value' => $generatedValue,
'is_build_time' => false, 'is_build_time' => false,
'application_id' => $resource->id, 'resourceable_type' => get_class($resource),
'resourceable_id' => $resource->id,
'is_preview' => false, 'is_preview' => false,
]); ]);
} }
@@ -2712,7 +2716,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
} }
$foundEnv = EnvironmentVariable::where([ $foundEnv = EnvironmentVariable::where([
'key' => $key, 'key' => $key,
'application_id' => $resource->id, 'resourceable_type' => get_class($resource),
'resourceable_id' => $resource->id,
'is_preview' => false, 'is_preview' => false,
])->first(); ])->first();
if ($foundEnv) { if ($foundEnv) {
@@ -2722,7 +2727,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
if ($foundEnv) { if ($foundEnv) {
$foundEnv->update([ $foundEnv->update([
'key' => $key, 'key' => $key,
'application_id' => $resource->id, 'resourceable_type' => get_class($resource),
'resourceable_id' => $resource->id,
'is_build_time' => $isBuildTime, 'is_build_time' => $isBuildTime,
'value' => $defaultValue, 'value' => $defaultValue,
]); ]);
@@ -2731,7 +2737,8 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
'key' => $key, 'key' => $key,
'value' => $defaultValue, 'value' => $defaultValue,
'is_build_time' => $isBuildTime, 'is_build_time' => $isBuildTime,
'application_id' => $resource->id, 'resourceable_type' => get_class($resource),
'resourceable_id' => $resource->id,
'is_preview' => false, 'is_preview' => false,
]); ]);
} }

View File

@@ -2,7 +2,7 @@
return [ return [
'coolify' => [ 'coolify' => [
'version' => '4.0.0-beta.385', 'version' => '4.0.0-beta.386',
'self_hosted' => env('SELF_HOSTED', true), 'self_hosted' => env('SELF_HOSTED', true),
'autoupdate' => env('AUTOUPDATE'), 'autoupdate' => env('AUTOUPDATE'),
'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'), 'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'),

View File

@@ -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());
}
}
};

View File

@@ -11,7 +11,7 @@ ARG DOCKER_BUILDX_VERSION=0.19.3
# https://github.com/buildpacks/pack/releases # https://github.com/buildpacks/pack/releases
ARG PACK_VERSION=0.36.2 ARG PACK_VERSION=0.36.2
# https://github.com/railwayapp/nixpacks/releases # https://github.com/railwayapp/nixpacks/releases
ARG NIXPACKS_VERSION=1.30.0 ARG NIXPACKS_VERSION=1.32.0
# https://github.com/minio/mc/releases # https://github.com/minio/mc/releases
ARG MINIO_VERSION=RELEASE.2024-11-21T17-21-54Z ARG MINIO_VERSION=RELEASE.2024-11-21T17-21-54Z

View File

@@ -1,10 +1,10 @@
{ {
"coolify": { "coolify": {
"v4": { "v4": {
"version": "4.0.0-beta.385" "version": "4.0.0-beta.386"
}, },
"nightly": { "nightly": {
"version": "4.0.0-beta.386" "version": "4.0.0-beta.387"
}, },
"helper": { "helper": {
"version": "1.0.4" "version": "1.0.4"