From f1c33db9bead0f44f4aba413c8e82ffa6c00abcc Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Thu, 12 Dec 2024 09:55:00 +0530 Subject: [PATCH 1/4] chore: dedicated deployments separation for ut and dt --- .../workflows/prepare-for-prod-dt-deploy.yml | 12 +++--- .../workflows/prepare-for-prod-ut-deploy.yml | 38 +++++++++++++++++++ 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/.github/workflows/prepare-for-prod-dt-deploy.yml b/.github/workflows/prepare-for-prod-dt-deploy.yml index 0a61a359bf..63f346326a 100644 --- a/.github/workflows/prepare-for-prod-dt-deploy.yml +++ b/.github/workflows/prepare-for-prod-dt-deploy.yml @@ -159,7 +159,7 @@ jobs: cd customer-objects - declare -a enabled_ut_customers=() + declare -a enabled_dt_customers=() declare -a sub_directories=('enterprise-us' 'enterprise-eu') # identify the customers enabled in sub-directories @@ -167,17 +167,17 @@ jobs: for f in "./$directory"/*; do [[ -f $f ]] || continue - enabled="$(yq e '.spec.user_transformer.enabled' $f)" + enabled="$(yq e '.spec.transformer.enabled' $f)" if [ $enabled == "true" ]; then - enabled_ut_customers+=( $f ) + enabled_dt_customers+=( $f ) fi done done # bump up the customers version and repository information - for customer in "${enabled_ut_customers[@]}"; do - yq eval -i ".spec.user_transformer.image.version=\"$TAG_NAME\"" $customer - yq eval -i ".spec.user_transformer.image.repository=\"$TF_IMAGE_REPOSITORY\"" $customer + for customer in "${enabled_dt_customers[@]}"; do + yq eval -i ".spec.transformer.image.version=\"$TAG_NAME\"" $customer + yq eval -i ".spec.transformer.image.repository=\"$TF_IMAGE_REPOSITORY\"" $customer git add $customer done diff --git a/.github/workflows/prepare-for-prod-ut-deploy.yml b/.github/workflows/prepare-for-prod-ut-deploy.yml index 3053979b3e..6fac5784d9 100644 --- a/.github/workflows/prepare-for-prod-ut-deploy.yml +++ b/.github/workflows/prepare-for-prod-ut-deploy.yml @@ -29,6 +29,7 @@ jobs: if: ((startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release/')) && github.event.pull_request.merged == true) outputs: tag_name_ut: ${{ steps.gen_tag_names.outputs.tag_name_ut }} + tag_name: ${{ steps.gen_tag_names.outputs.tag_name }} steps: - name: Checkout uses: actions/checkout@v4.2.1 @@ -71,6 +72,7 @@ jobs: needs: [generate-tag-names, build-user-transformer-image] env: UT_TAG_NAME: ${{ needs.generate-tag-names.outputs.tag_name_ut }} + TAG_NAME: ${{ needs.generate-tag-names.outputs.tag_name }} TF_IMAGE_REPOSITORY: rudderstack/rudder-transformer steps: - name: Checkout @@ -134,3 +136,39 @@ jobs: git push -u origin hosted-user-transformer-$UT_TAG_NAME gh pr create --fill + + - name: Update helm charts and raise pull request for enterprise customers on dedicated transformers + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + run: | + cd rudder-devops + git checkout -b dedicated-transformer-$TAG_NAME + + cd customer-objects + + declare -a enabled_ut_customers=() + declare -a sub_directories=('enterprise-us' 'enterprise-eu') + + # identify the customers enabled in sub-directories + for directory in "${sub_directories[@]}"; do + for f in "./$directory"/*; do + [[ -f $f ]] || continue + + enabled="$(yq e '.spec.user_transformer.enabled' $f)" + if [ $enabled == "true" ]; then + enabled_ut_customers+=( $f ) + fi + done + done + + # bump up the customers version and repository information + for customer in "${enabled_ut_customers[@]}"; do + yq eval -i ".spec.user_transformer.image.version=\"$TAG_NAME\"" $customer + yq eval -i ".spec.user_transformer.image.repository=\"$TF_IMAGE_REPOSITORY\"" $customer + git add $customer + done + + git commit -m "chore: upgrade dedicated transformers to $TAG_NAME" + git push -u origin dedicated-transformer-$TAG_NAME + + gh pr create --fill \ No newline at end of file From b16045562ea02b4d3b02f8cb509599611517f377 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Thu, 12 Dec 2024 09:58:05 +0530 Subject: [PATCH 2/4] chore: update commit msg for dt --- .github/workflows/prepare-for-prod-dt-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prepare-for-prod-dt-deploy.yml b/.github/workflows/prepare-for-prod-dt-deploy.yml index 63f346326a..56fda56b70 100644 --- a/.github/workflows/prepare-for-prod-dt-deploy.yml +++ b/.github/workflows/prepare-for-prod-dt-deploy.yml @@ -181,7 +181,7 @@ jobs: git add $customer done - git commit -m "chore: upgrade dedicated transformers to $TAG_NAME" + git commit -m "chore: upgrade dedicated dt transformers to $TAG_NAME" git push -u origin dedicated-transformer-$TAG_NAME gh pr create --fill From 9c8f36d2d2ccf6e5dfe9a5bfc2d742ce163b32e8 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Thu, 12 Dec 2024 10:00:32 +0530 Subject: [PATCH 3/4] chore: update ut dedicated deployment branch and commit msg --- .github/workflows/prepare-for-prod-ut-deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/prepare-for-prod-ut-deploy.yml b/.github/workflows/prepare-for-prod-ut-deploy.yml index 6fac5784d9..d88459334c 100644 --- a/.github/workflows/prepare-for-prod-ut-deploy.yml +++ b/.github/workflows/prepare-for-prod-ut-deploy.yml @@ -142,7 +142,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.PAT }} run: | cd rudder-devops - git checkout -b dedicated-transformer-$TAG_NAME + git checkout -b dedicated-transformer-ut-$TAG_NAME cd customer-objects @@ -168,7 +168,7 @@ jobs: git add $customer done - git commit -m "chore: upgrade dedicated transformers to $TAG_NAME" - git push -u origin dedicated-transformer-$TAG_NAME + git commit -m "chore: upgrade dedicated ut transformers to $TAG_NAME" + git push -u origin dedicated-transformer-ut-$TAG_NAME gh pr create --fill \ No newline at end of file From 2e53f2ea63eaf6703ca7b7bbb0455d78bccee1c1 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Thu, 12 Dec 2024 10:02:46 +0530 Subject: [PATCH 4/4] chore: update branch for dedicated ut deployment --- .github/workflows/prepare-for-prod-ut-deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/prepare-for-prod-ut-deploy.yml b/.github/workflows/prepare-for-prod-ut-deploy.yml index d88459334c..612dddc833 100644 --- a/.github/workflows/prepare-for-prod-ut-deploy.yml +++ b/.github/workflows/prepare-for-prod-ut-deploy.yml @@ -142,7 +142,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.PAT }} run: | cd rudder-devops - git checkout -b dedicated-transformer-ut-$TAG_NAME + git checkout -b dedicated-user-transformer-$TAG_NAME cd customer-objects @@ -168,7 +168,7 @@ jobs: git add $customer done - git commit -m "chore: upgrade dedicated ut transformers to $TAG_NAME" - git push -u origin dedicated-transformer-ut-$TAG_NAME + git commit -m "chore: upgrade dedicated user transformers to $TAG_NAME" + git push -u origin dedicated-user-transformer-$TAG_NAME gh pr create --fill \ No newline at end of file