From fbbaf91bc61715f34736b34606e1a559b9e2d4d8 Mon Sep 17 00:00:00 2001 From: Veronika Gnilitska Date: Thu, 8 May 2025 16:13:24 +0300 Subject: [PATCH 1/3] chore: updates repos and optimizes sync-all --- lib/os-modules/Taskfile.yaml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/os-modules/Taskfile.yaml b/lib/os-modules/Taskfile.yaml index 1f6bda0..e3c658c 100644 --- a/lib/os-modules/Taskfile.yaml +++ b/lib/os-modules/Taskfile.yaml @@ -7,6 +7,8 @@ vars: terraform-datadog-users \ terraform-github-teams \ terraform-github-organization \ + terraform-googleworkspace-user-group-management \ + terraform-googleworkspace-users-groups-automation \ terraform-postgres-automation \ terraform-secrets-helper \ terraform-spacelift-automation \ @@ -14,6 +16,7 @@ vars: terraform-spacelift-events-collector-audit-trail \ terraform-spacelift-policies SYNC_BRANCH: chore/sync-with-template + SHARED_TMP_DIR: .tmp-template-sync tasks: sync: desc: | @@ -38,10 +41,7 @@ tasks: .terraform-docs.yaml LICENSE aqua.yaml - TMP_DIR: .tmp-template-sync cmds: - - rm -rf {{.TMP_DIR}} - - git clone --depth 1 https://github.com/masterpointio/terraform-module-template.git {{.TMP_DIR}} - | # Convert newlines to spaces and remove backslashes modules=$(echo "{{.MODULES}}" | tr '\n' ' ' | sed 's/\\//g') @@ -51,10 +51,9 @@ tasks: for file in {{.FILES}} do echo " Syncing $file" - rsync -av --delete {{.TMP_DIR}}/$file ../$module/ + rsync -av --delete {{.SHARED_TMP_DIR}}/$file ../$module/ done done - - rm -rf {{.TMP_DIR}} pull-and-branch: desc: | @@ -114,6 +113,17 @@ tasks: cd - done + setup-template: + desc: Set up the template repository in a shared temporary directory + cmds: + - rm -rf {{.SHARED_TMP_DIR}} + - git clone --depth 1 https://github.com/masterpointio/terraform-module-template.git {{.SHARED_TMP_DIR}} + + cleanup-template: + desc: Clean up the shared temporary directory + cmds: + - rm -rf {{.SHARED_TMP_DIR}} + sync-all: desc: | Pull main branch, create a sync branch, and sync with template for specified Terraform open-source module repos. @@ -130,5 +140,7 @@ tasks: vars: MODULES: "{{if .CLI_ARGS}}{{.CLI_ARGS}}{{else}}{{.DEFAULT_MODULES}}{{end}}" cmds: + - task: setup-template - task: pull-and-branch - task: sync + - task: cleanup-template From ff54bc863660e93842db9170abbc0e4d88a7f605 Mon Sep 17 00:00:00 2001 From: Veronika Gnilitska <30597968+gberenice@users.noreply.github.com> Date: Fri, 9 May 2025 16:07:57 +0300 Subject: [PATCH 2/3] chore: DRY command Co-authored-by: Matt Gowie --- lib/os-modules/Taskfile.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/os-modules/Taskfile.yaml b/lib/os-modules/Taskfile.yaml index e3c658c..f6aa066 100644 --- a/lib/os-modules/Taskfile.yaml +++ b/lib/os-modules/Taskfile.yaml @@ -116,7 +116,7 @@ tasks: setup-template: desc: Set up the template repository in a shared temporary directory cmds: - - rm -rf {{.SHARED_TMP_DIR}} + - task: cleanup-template - git clone --depth 1 https://github.com/masterpointio/terraform-module-template.git {{.SHARED_TMP_DIR}} cleanup-template: From 1a8e4fc29f40626174e9548c2e12066864f17db7 Mon Sep 17 00:00:00 2001 From: Veronika Gnilitska Date: Fri, 9 May 2025 18:53:48 +0300 Subject: [PATCH 3/3] fix: remove repo --- lib/os-modules/Taskfile.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/os-modules/Taskfile.yaml b/lib/os-modules/Taskfile.yaml index f6aa066..227ea8b 100644 --- a/lib/os-modules/Taskfile.yaml +++ b/lib/os-modules/Taskfile.yaml @@ -7,7 +7,6 @@ vars: terraform-datadog-users \ terraform-github-teams \ terraform-github-organization \ - terraform-googleworkspace-user-group-management \ terraform-googleworkspace-users-groups-automation \ terraform-postgres-automation \ terraform-secrets-helper \