refactor: naming

This commit is contained in:
cha0s 2022-03-02 02:27:43 -06:00
parent 3d3181ebf4
commit 770aea475e

View File

@ -27,8 +27,9 @@ export default (program, flecks) => {
'services:',
'',
];
const appServiceName = `${flecks.get('@flecks/core.id')}_app`;
const services = {
app: {
[appServiceName]: {
build: {
context: '..',
dockerfile: 'dist/Dockerfile',
@ -65,8 +66,10 @@ export default (program, flecks) => {
.forEach(([configService, environment]) => {
Object.entries(environment || {})
.forEach(([key, value]) => {
const qualified = 'app' === configService ? `${prefix}_${key}` : key;
services[configService].environment[qualified] = value;
const [realKey, realService] = 'app' === configService
? [`${prefix}_${key}`, appServiceName]
: [key, configService];
services[realService].environment[realKey] = value;
});
});
});