feat: multi-keys

This commit is contained in:
devthejo 2024-01-25 23:35:50 +01:00
parent bed839c096
commit ebd9608380
Signed by: devthejo
GPG key ID: C04215C627711F5C

View file

@ -46,11 +46,14 @@ const main = async () => {
for (const env of envs) {
const { name, key = cdKey, tag = defaultTag } = app;
const valuesFile = `apps/${name}/envs/${env}/values.yaml`;
console.log(`${valuesFile} -> ${key}=${tag}`);
const keys = key.split(",")
const valuesFilePath = `${workingDir}/${valuesFile}`;
const valuesRaw = await fs.readFile(valuesFilePath, { encoding: "utf-8" })
const values = yaml.parse(valuesRaw);
set(values, key, tag);
for(const k of keys){
console.log(`${valuesFile} -> ${k}=${tag}`);
set(values, k, tag);
}
await fs.writeFile(valuesFilePath, yaml.stringify(values));
}
}