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];
let build = typeof value['build'] === 'undefined' ? [] : value['build'];
if (Object.keys(build).length > 0) {
build = Object.entries(build).map(([key, value]) => `${key}=${value}`);
let build = typeof value['build'] === 'undefined' ? {} : value['build'];
let buildArgs = typeof build['args'] === 'undefined' ? [] : value['args'];
if (Object.keys(buildArgs).length > 0) {
buildArgs = Object.entries(buildArgs).map(([key, value]) => `${key}=${value}`);
}
value['build'] = {
...build,
args: [...(build?.args || []), ...buildEnvs]
args: [...buildArgs, ...buildEnvs]
};
value['labels'] = labels;