Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

feat: check version in environment variable #146

Merged
merged 1 commit into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion config/autoload/config.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@
// But for now, it's not. So we have to do it here.
$isProduction = strtoupper($environment) === 'APP';

// ECS will now set the version via. environment variables.
// Once fully migrated, the `../version` file can be removed, and this can be simplified.
$ecsVersion = getenv('APP_VERSION');
$ec2Version = file_exists(__DIR__ . '/../version') ? file_get_contents(__DIR__ . '/../version') : null;

return [
'version' => $isProduction ? null : [
'environment' => $environment,
'release' => (file_exists(__DIR__ . '/../version') ? file_get_contents(__DIR__ . '/../version') : ''),
'release' => ($ecsVersion ?: $ec2Version ?: 'LOCAL'),
'description' => '%domain%',
],
'api_router' => [
Expand Down
1 change: 0 additions & 1 deletion config/autoload/local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ return [
// Debugging, display environment and version on interface
'version' => [
'environment' => 'localdev',
'release' => (file_exists(__DIR__ . '/../version') ? file_get_contents(__DIR__ . '/../version') : ''),
'description' => 'olcs.localdev',
],

Expand Down
Loading