chore: change to BACKSTAGE_ENV

as per review

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
This commit is contained in:
Hellgren Heikki
2025-09-08 08:47:51 +03:00
parent b321dd9040
commit 5798d2566f
4 changed files with 10 additions and 13 deletions
@@ -90,7 +90,7 @@ describe('ConfigSources', () => {
{ name: 'FileConfigSource', path: `${root}app-config.local.yaml` },
]);
process.env = Object.assign(process.env, { BACKSTAGE_ENVIRONMENT: 'test' });
process.env = Object.assign(process.env, { BACKSTAGE_ENV: 'test' });
expect(
mergeSources(
ConfigSources.defaultForTargets({ rootDir: '/', targets: [] }),
@@ -184,11 +184,11 @@ export class ConfigSources {
const localPath = resolvePath(rootDir, 'app-config.local.yaml');
const envPath = resolvePath(
rootDir,
`app-config.${process.env.BACKSTAGE_ENVIRONMENT}.yaml`,
`app-config.${process.env.BACKSTAGE_ENV}.yaml`,
);
const envLocalPath = resolvePath(
rootDir,
`app-config.${process.env.BACKSTAGE_ENVIRONMENT}.local.yaml`,
`app-config.${process.env.BACKSTAGE_ENV}.local.yaml`,
);
const alwaysIncludeDefaultConfigSource =
!options.allowMissingDefaultConfig;
@@ -203,7 +203,7 @@ export class ConfigSources {
);
}
if (process.env.BACKSTAGE_ENVIRONMENT && fs.pathExistsSync(envPath)) {
if (process.env.BACKSTAGE_ENV && fs.pathExistsSync(envPath)) {
argSources.push(
FileConfigSource.create({
watch: options.watch,
@@ -223,10 +223,7 @@ export class ConfigSources {
);
}
if (
process.env.BACKSTAGE_ENVIRONMENT &&
fs.pathExistsSync(envLocalPath)
) {
if (process.env.BACKSTAGE_ENV && fs.pathExistsSync(envLocalPath)) {
argSources.push(
FileConfigSource.create({
watch: options.watch,