Skip to content

Commit

Permalink
feat: check version in environment variable (dvsa/olcs-internal#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaLicense authored May 13, 2024
1 parent ad3def6 commit 3fba046
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/internal/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 app/internal/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

0 comments on commit 3fba046

Please sign in to comment.