chore: add configuration for on-prem env [WPB-3615]#20524
chore: add configuration for on-prem env [WPB-3615]#20524
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #20524 +/- ##
==========================================
- Coverage 45.44% 45.44% -0.01%
==========================================
Files 1637 1637
Lines 40361 40361
Branches 8332 8332
==========================================
- Hits 18342 18341 -1
Misses 20086 20086
- Partials 1933 1934 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
🔗 Download Full Report Artifact 🧪 Playwright Test Summary
|
| const fs = require('fs'); | ||
| const path = require('path'); | ||
| const {spawn} = require('child_process'); |
There was a problem hiding this comment.
Avoid CommonJS (it's legacy/deprecated) at all costs and use ECMAScript modules
| const {spawn} = require('child_process'); | ||
|
|
||
| // Parse command line arguments | ||
| const args = process.argv.slice(2); |
| const environment = args[0] || 'dev'; | ||
|
|
||
| // Available environments | ||
| const availableEnvs = ['dev', 'anta', 'bella', 'chala', 'fulu', 'imai', 'foma']; |
There was a problem hiding this comment.
| const availableEnvs = ['dev', 'anta', 'bella', 'chala', 'fulu', 'imai', 'foma']; | |
| const availableEnvs = ['dev', 'anta', 'bella', 'chala', 'fulu', 'imai', 'foma'] as const; |
|
|
||
| // Parse command line arguments | ||
| const args = process.argv.slice(2); | ||
| const environment = args[0] || 'dev'; |
There was a problem hiding this comment.
| const environment = args[0] || 'dev'; | |
| const environment = args[0] ?? 'dev'; |
|
|
||
| for (const line of lines) { | ||
| // Skip empty lines and comments | ||
| if (!line.trim() || line.trim().startsWith('#')) { |
There was a problem hiding this comment.
| if (!line.trim() || line.trim().startsWith('#')) { | |
| const trimmedLine = line.trim(); | |
| if (trimmedLine === '' || trimmedLine.startsWith('#')) { |
| if (!availableEnvs.includes(environment)) { | ||
| console.error(`\n❌ Invalid environment: ${environment}`); | ||
| showUsage(); | ||
| process.exit(1); |
There was a problem hiding this comment.
| process.exit(1); | |
| process.exitCode = 1; |
| @@ -0,0 +1,207 @@ | |||
| #!/usr/bin/env node | |||
There was a problem hiding this comment.
For the whole file we don't have any tests that verify the expected behavior
| @@ -0,0 +1,45 @@ | |||
| # Active environment: anta (merged with base .env) | |||
There was a problem hiding this comment.
.env.backup is not a backup right? It's more like a fallback or default as far as I can see?



Pull Request
Summary
Added a script to dynamically switch environments without manually editing .env files.
Changes:
Created
start-with-env.js- accepts environment parameter (dev, anta, bella, chala, fulu, imai, foma)Updated yarn start to support yarn start [environment]
Moved all .env.* files to env/ folder for better organization
Security Checklist (required)
Accessibility (required)
Standards Acknowledgement (required)
Screenshots or demo (if the user interface changed)
Notes for reviewers