From 5820d2a07efd36daf5ed8e3a80cbfc6e61dce8ba Mon Sep 17 00:00:00 2001 From: YannickVR Date: Tue, 1 Oct 2024 19:35:59 +0200 Subject: [PATCH 1/4] fixed quotes around TF vars so lists are not passed as variables --- src/plugin/impl/tf-apply-task-plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin/impl/tf-apply-task-plugin.ts b/src/plugin/impl/tf-apply-task-plugin.ts index b1f2a111..acfad6dc 100644 --- a/src/plugin/impl/tf-apply-task-plugin.ts +++ b/src/plugin/impl/tf-apply-task-plugin.ts @@ -182,7 +182,7 @@ export class TfBuildTaskPlugin implements IBuildTaskPlugin): string { if (!parameters) { return ''; } const entries = Object.entries(parameters); - return entries.reduce((prev, curr) => prev + ` -var "${curr[0]}=${curr[1]}"`, ''); + return entries.reduce((prev, curr) => prev + ` -var '${curr[0]}=${curr[1]}'`, ''); } static GetBackendConfigAsArgument(backendConfig: Record): string { From cca59dae6d990a1f876e21b8883c4aa8ade4722e Mon Sep 17 00:00:00 2001 From: YannickVR Date: Tue, 1 Oct 2024 20:03:29 +0200 Subject: [PATCH 2/4] fix:properly handle array --- src/plugin/impl/tf-apply-task-plugin.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugin/impl/tf-apply-task-plugin.ts b/src/plugin/impl/tf-apply-task-plugin.ts index acfad6dc..6943e741 100644 --- a/src/plugin/impl/tf-apply-task-plugin.ts +++ b/src/plugin/impl/tf-apply-task-plugin.ts @@ -182,8 +182,15 @@ export class TfBuildTaskPlugin implements IBuildTaskPlugin): string { if (!parameters) { return ''; } const entries = Object.entries(parameters); - return entries.reduce((prev, curr) => prev + ` -var '${curr[0]}=${curr[1]}'`, ''); + + return entries.reduce((prev, [key, value]) => { + if (Array.isArray(value)) { + value = JSON.stringify(value); + } + return prev + ` -var '${key}=${value}'`; + }, ''); } + static GetBackendConfigAsArgument(backendConfig: Record): string { if (!backendConfig) { return ''; } From 86f1b1fa583b751b5ed52cab530e03f3edde3284 Mon Sep 17 00:00:00 2001 From: YannickVR Date: Tue, 1 Oct 2024 20:04:09 +0200 Subject: [PATCH 3/4] chore:remove whitespace --- src/plugin/impl/tf-apply-task-plugin.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugin/impl/tf-apply-task-plugin.ts b/src/plugin/impl/tf-apply-task-plugin.ts index 6943e741..d1db69dd 100644 --- a/src/plugin/impl/tf-apply-task-plugin.ts +++ b/src/plugin/impl/tf-apply-task-plugin.ts @@ -191,7 +191,6 @@ export class TfBuildTaskPlugin implements IBuildTaskPlugin): string { if (!backendConfig) { return ''; } const entries = Object.entries(backendConfig); From 17d7dd406230bbfcc50060702d1f7f47f9b905d2 Mon Sep 17 00:00:00 2001 From: YannickVR Date: Tue, 1 Oct 2024 20:07:00 +0200 Subject: [PATCH 4/4] chore:remove whitespace --- src/plugin/impl/tf-apply-task-plugin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugin/impl/tf-apply-task-plugin.ts b/src/plugin/impl/tf-apply-task-plugin.ts index d1db69dd..4037f8b1 100644 --- a/src/plugin/impl/tf-apply-task-plugin.ts +++ b/src/plugin/impl/tf-apply-task-plugin.ts @@ -182,7 +182,7 @@ export class TfBuildTaskPlugin implements IBuildTaskPlugin): string { if (!parameters) { return ''; } const entries = Object.entries(parameters); - + return entries.reduce((prev, [key, value]) => { if (Array.isArray(value)) { value = JSON.stringify(value); @@ -190,7 +190,7 @@ export class TfBuildTaskPlugin implements IBuildTaskPlugin): string { if (!backendConfig) { return ''; } const entries = Object.entries(backendConfig);