mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-05 14:23:10 +00:00
feat(railpack): expose COOLIFY_* vars at build time and generalize buildpack control flag
Mirrors Nixpacks behavior: inject COOLIFY_* and SOURCE_COMMIT into railpack build variables so apps (e.g. SPAs baking public URLs) can read them via /run/secrets/<KEY>. Rename is_nixpacks → is_buildpack_control to cover both NIXPACKS_ and RAILPACK_ prefixed keys. Update the env variable view and appends list accordingly. Promote generate_coolify_env_variables to protected for testability.
This commit is contained in:
@@ -77,7 +77,7 @@ class EnvironmentVariable extends BaseModel
|
||||
'resourceable_id' => 'integer',
|
||||
];
|
||||
|
||||
protected $appends = ['real_value', 'is_shared', 'is_really_required', 'is_nixpacks', 'is_coolify'];
|
||||
protected $appends = ['real_value', 'is_shared', 'is_really_required', 'is_buildpack_control', 'is_coolify'];
|
||||
|
||||
protected static function booted()
|
||||
{
|
||||
@@ -215,16 +215,10 @@ class EnvironmentVariable extends BaseModel
|
||||
);
|
||||
}
|
||||
|
||||
protected function isNixpacks(): Attribute
|
||||
protected function isBuildpackControl(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function () {
|
||||
if (str($this->key)->startsWith('NIXPACKS_')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
get: fn () => self::isBuildpackControlKey($this->key),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user