Fix docker-compose build args

This commit is contained in:
Talha Zekeriya Durmuş 2023-01-17 02:04:01 +01:00 committed by GitHub
parent bfd3020031
commit db5cd21884
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,13 +52,14 @@ export default async function (data) {
} }
value['environment'] = [...environment, ...envs]; value['environment'] = [...environment, ...envs];
let build = typeof value['build'] === 'undefined' ? [] : value['build']; let build = typeof value['build'] === 'undefined' ? {} : value['build'];
if (Object.keys(build).length > 0) { let buildArgs = typeof build['args'] === 'undefined' ? [] : value['args'];
build = Object.entries(build).map(([key, value]) => `${key}=${value}`); if (Object.keys(buildArgs).length > 0) {
buildArgs = Object.entries(buildArgs).map(([key, value]) => `${key}=${value}`);
} }
value['build'] = { value['build'] = {
...build, ...build,
args: [...(build?.args || []), ...buildEnvs] args: [...buildArgs, ...buildEnvs]
}; };
value['labels'] = labels; value['labels'] = labels;