feat: apply buildargs

This commit is contained in:
Lorenzo Migliorero
2024-07-22 11:52:20 +02:00
parent b3b7439617
commit 3601abc4c1
3 changed files with 18 additions and 16 deletions

View File

@@ -161,6 +161,21 @@ export const removeService = async (appName: string) => {
export const prepareEnvironmentVariables = (env: string | null) =>
Object.entries(parse(env ?? "")).map(([key, value]) => `${key}=${value}`);
export const prepareBuildArgs = (input: string | null) => {
const pairs = (input ?? "").split(" ");
const jsonObject: Record<string, string> = {};
for (const pair of pairs) {
const [key, value] = pair.split("=");
if (key && value) {
jsonObject[key] = value;
}
}
return jsonObject;
};
export const generateVolumeMounts = (mounts: ApplicationNested["mounts"]) => {
if (!mounts || mounts.length === 0) {
return [];