From 3cce637414bb9e073f1c53f7fcd10a01d31268a3 Mon Sep 17 00:00:00 2001 From: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> Date: Mon, 18 Sep 2023 18:12:55 +0530 Subject: [PATCH] fix: seperate build steps for ruddestack and rudderlabs repo --- .github/workflows/prepare-for-prod-deploy.yml | 24 ++++++++-- .../workflows/prepare-for-prod-ut-deploy.yml | 25 ++++++++-- .../workflows/prepare-for-staging-deploy.yml | 47 ++++++++++++++++--- 3 files changed, 81 insertions(+), 15 deletions(-) diff --git a/.github/workflows/prepare-for-prod-deploy.yml b/.github/workflows/prepare-for-prod-deploy.yml index df96daa8a9..818bd32bd1 100644 --- a/.github/workflows/prepare-for-prod-deploy.yml +++ b/.github/workflows/prepare-for-prod-deploy.yml @@ -39,15 +39,31 @@ jobs: echo "Tag Name: $tag_name" echo "tag_name=$tag_name" >> $GITHUB_OUTPUT - build-transformer-image: - name: Build Transformer Docker Image - Prod + build-rudderstack-transformer-image: + name: Build Transformer Docker Image for Rudderstack org- Prod # Only merged pull requests from release candidate branches must trigger if: ((startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release/')) && github.event.pull_request.merged == true) needs: [generate-tag-names] uses: ./.github/workflows/build-push-docker-image.yml with: build_tag: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }} - push_tags: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }},rudderstack/rudder-transformer:latest,rudderlabs/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }},rudderlabs/rudder-transformer:latest + push_tags: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }},rudderstack/rudder-transformer:latest + img_tag: ${{ needs.generate-tag-names.outputs.tag_name }} + dockerfile: Dockerfile + load_target: development + push_target: production + secrets: + DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + + build-rudderlabs-transformer-image: + name: Build Transformer Docker Image for Rudderlabs org - Prod + # Only merged pull requests from release candidate branches must trigger + if: ((startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release/')) && github.event.pull_request.merged == true) + needs: [generate-tag-names] + uses: ./.github/workflows/build-push-docker-image.yml + with: + build_tag: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }} + push_tags: rudderlabs/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }},rudderlabs/rudder-transformer:latest img_tag: ${{ needs.generate-tag-names.outputs.tag_name }} dockerfile: Dockerfile load_target: development @@ -58,7 +74,7 @@ jobs: create-pull-request: name: Update Helm Charts For Production and Create Pull Request runs-on: ubuntu-latest - needs: [generate-tag-names, build-transformer-image] + needs: [generate-tag-names, build-rudderstack-transformer-image, build-rudderlabs-transformer-image] env: TAG_NAME: ${{ needs.generate-tag-names.outputs.tag_name }} TF_IMAGE_REPOSITORY: rudderstack/rudder-transformer diff --git a/.github/workflows/prepare-for-prod-ut-deploy.yml b/.github/workflows/prepare-for-prod-ut-deploy.yml index 2016b35231..511e21d6dd 100644 --- a/.github/workflows/prepare-for-prod-ut-deploy.yml +++ b/.github/workflows/prepare-for-prod-ut-deploy.yml @@ -42,15 +42,15 @@ jobs: echo "UT Tag Name: $tag_name_ut" echo "tag_name_ut=$tag_name_ut" >> $GITHUB_OUTPUT - build-user-transformer-image: - name: Build User Transformer Docker Image - Prod + build-rudderstack-user-transformer-image: + name: Build User Transformer Docker Image for Rudderstack org - Prod # Only merged pull requests from release candidate branches must trigger if: ((startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release/')) && github.event.pull_request.merged == true) needs: [generate-tag-names] uses: ./.github/workflows/build-push-docker-image.yml with: build_tag: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }} - push_tags: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }},rudderstack/rudder-transformer:ut-latest,rudderlabs/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }},rudderlabs/rudder-transformer:ut-latest + push_tags: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }},rudderstack/rudder-transformer:ut-latest img_tag: ${{ needs.generate-tag-names.outputs.tag_name_ut }} dockerfile: Dockerfile-ut-func load_target: development @@ -58,10 +58,27 @@ jobs: secrets: DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + build-rudderlabs-user-transformer-image: + name: Build User Transformer Docker Image for Rudderlabs org - Prod + # Only merged pull requests from release candidate branches must trigger + if: ((startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release/')) && github.event.pull_request.merged == true) + needs: [generate-tag-names] + uses: ./.github/workflows/build-push-docker-image.yml + with: + build_tag: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }} + push_tags: rudderlabs/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }},rudderlabs/rudder-transformer:ut-latest + img_tag: ${{ needs.generate-tag-names.outputs.tag_name_ut }} + dockerfile: Dockerfile-ut-func + load_target: development + push_target: production + secrets: + DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + + create-pull-request: name: Update Helm Charts For Production and Create Pull Request runs-on: ubuntu-latest - needs: [generate-tag-names, build-user-transformer-image] + needs: [generate-tag-names, build-rudderstack-user-transformer-image, build-rudderlabs-user-transformer-image] env: UT_TAG_NAME: ${{ needs.generate-tag-names.outputs.tag_name_ut }} TF_IMAGE_REPOSITORY: rudderstack/rudder-transformer diff --git a/.github/workflows/prepare-for-staging-deploy.yml b/.github/workflows/prepare-for-staging-deploy.yml index 786110944f..4b63b70640 100644 --- a/.github/workflows/prepare-for-staging-deploy.yml +++ b/.github/workflows/prepare-for-staging-deploy.yml @@ -35,15 +35,15 @@ jobs: echo "UT Tag Name: $tag_name_ut" echo "tag_name_ut=$tag_name_ut" >> $GITHUB_OUTPUT - build-transformer-image: - name: Build Transformer Docker Image - Staging + build-rudderstack-transformer-image: + name: Build Transformer Docker Image For Rudderstack org - Staging # Only pull requests from release candidate branches must trigger if: (startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release/')) needs: [generate-tag-names] uses: ./.github/workflows/build-push-docker-image.yml with: build_tag: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }} - push_tags: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }},rudderlabs/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }} + push_tags: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }} img_tag: ${{ needs.generate-tag-names.outputs.tag_name }} dockerfile: Dockerfile load_target: development @@ -51,8 +51,41 @@ jobs: secrets: DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }} - build-user-transformer-image: - name: Build User Transformer Docker Image - Staging + build-rudderlabs-transformer-image: + name: Build Transformer Docker Image For Rudderlabs org - Staging + # Only pull requests from release candidate branches must trigger + if: (startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release/')) + needs: [generate-tag-names] + uses: ./.github/workflows/build-push-docker-image.yml + with: + build_tag: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }} + push_tags: rudderlabs/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name }} + img_tag: ${{ needs.generate-tag-names.outputs.tag_name }} + dockerfile: Dockerfile + load_target: development + push_target: production + secrets: + DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + + build-rudderstack-user-transformer-image: + name: Build User Transformer Docker Image For Rudderstack org - Staging + # Only pull requests from release candidate branches must trigger + if: (startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release/')) + + needs: [generate-tag-names] + uses: ./.github/workflows/build-push-docker-image.yml + with: + build_tag: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }} + push_tags: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }} + img_tag: ${{ needs.generate-tag-names.outputs.tag_name_ut }} + dockerfile: Dockerfile-ut-func + load_target: development + push_target: production + secrets: + DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }} + + build-rudderlabs-user-transformer-image: + name: Build User Transformer Docker Image For Rudderlabs org - Staging # Only pull requests from release candidate branches must trigger if: (startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release/')) @@ -60,7 +93,7 @@ jobs: uses: ./.github/workflows/build-push-docker-image.yml with: build_tag: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }} - push_tags: rudderstack/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }},rudderlabs/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }} + push_tags: rudderlabs/rudder-transformer:${{ needs.generate-tag-names.outputs.tag_name_ut }} img_tag: ${{ needs.generate-tag-names.outputs.tag_name_ut }} dockerfile: Dockerfile-ut-func load_target: development @@ -71,7 +104,7 @@ jobs: create-pull-request: name: Update Helm Charts For Staging and Create Pull Request runs-on: ubuntu-latest - needs: [generate-tag-names, build-transformer-image, build-user-transformer-image] + needs: [generate-tag-names, build-rudderstack-transformer-image, build-rudderlabs-transformer-image, build-rudderstack-user-transformer-image, build-rudderlabs-user-transformer-image] env: TAG_NAME: ${{ needs.generate-tag-names.outputs.tag_name }} UT_TAG_NAME: ${{ needs.generate-tag-names.outputs.tag_name_ut }}