From 9f8120258725ef9e9d98f9c8c80ed22c94727110 Mon Sep 17 00:00:00 2001 From: ruuushhh <66899387+ruuushhh@users.noreply.github.com> Date: Wed, 22 May 2024 15:00:54 +0530 Subject: [PATCH 1/5] Add workflow for create release branch (#804) * Add workflow for create release branch * update channel * update channel * Testing --- .github/workflows/create_release_branch.yaml | 41 ++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/create_release_branch.yaml diff --git a/.github/workflows/create_release_branch.yaml b/.github/workflows/create_release_branch.yaml new file mode 100644 index 000000000..333ba97d9 --- /dev/null +++ b/.github/workflows/create_release_branch.yaml @@ -0,0 +1,41 @@ +name: Create Release Branch +on: + schedule: + # Run every Friday at 11:30 AM UTC (5:00 PM IST) + - cron: '35 09 * * WED' +jobs: + create-release-branch: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: master + - name: Get Release Branch Name + run: | + echo "release_branch=integrations_app_release_$(date +%Y_%m_%d)" >> $GITHUB_ENV + echo "last_release_branch=integrations_app_release_$(date -d 'last friday' +%Y_%m_%d)" >> $GITHUB_ENV + - name: Check if release branch exists + run: | + if git ls-remote --exit-code --heads origin ${{env.release_branch}}; then + echo "branch_exists=true" >> $GITHUB_ENV + else + echo "branch_exists=false" >> $GITHUB_ENV + fi + - name: Create release branch + if: ${{env.branch_exists == 'false'}} + run: | + git checkout -b ${{env.release_branch}} + git push origin ${{env.release_branch}} + echo "message=Branch `${{env.release_branch}}` created successfully." >> $GITHUB_ENV + - name: Branch already exists + if: ${{env.branch_exists == 'true'}} + run: echo "message=Branch `${{env.release_branch}}` already exists." >> $GITHUB_ENV + - name: Send message on Slack + uses: archive/github-actions-slack@v2.0.1 + id: notify + with: + # Send message to #integrations slack channel + slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }} + slack-channel: C074E8V8EL8 + slack-text: "${{env.message}} \nCheck diff here: https://github.com/fylein/fyle-integrations-app/compare/${{env.last_release_branch}}...${{env.release_branch}}" \ No newline at end of file From 3c189cf5d4492ffb2d83561459cc02c3742f43ce Mon Sep 17 00:00:00 2001 From: ruuushhh <66899387+ruuushhh@users.noreply.github.com> Date: Wed, 22 May 2024 15:14:31 +0530 Subject: [PATCH 2/5] Testing release branch (#814) * Testing release branch * Testing release branch * Testing release branch * Testing release branch --- .github/workflows/create_release_branch.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_release_branch.yaml b/.github/workflows/create_release_branch.yaml index 333ba97d9..7d7c91f23 100644 --- a/.github/workflows/create_release_branch.yaml +++ b/.github/workflows/create_release_branch.yaml @@ -2,7 +2,7 @@ name: Create Release Branch on: schedule: # Run every Friday at 11:30 AM UTC (5:00 PM IST) - - cron: '35 09 * * WED' + - cron: '48 9 * * 3' jobs: create-release-branch: runs-on: ubuntu-latest From b78adb4dcc9849e056e4dc555d9a3837c58827b0 Mon Sep 17 00:00:00 2001 From: ruuushhh <66899387+ruuushhh@users.noreply.github.com> Date: Wed, 22 May 2024 15:22:52 +0530 Subject: [PATCH 3/5] Update Release branch time (#815) --- .github/workflows/create_release_branch.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_release_branch.yaml b/.github/workflows/create_release_branch.yaml index 7d7c91f23..85c5d9b9f 100644 --- a/.github/workflows/create_release_branch.yaml +++ b/.github/workflows/create_release_branch.yaml @@ -2,7 +2,7 @@ name: Create Release Branch on: schedule: # Run every Friday at 11:30 AM UTC (5:00 PM IST) - - cron: '48 9 * * 3' + - cron: '30 11 * * FRI' jobs: create-release-branch: runs-on: ubuntu-latest From 57f094a29c105628277c35f3111be18260d38b4a Mon Sep 17 00:00:00 2001 From: ruuushhh <66899387+ruuushhh@users.noreply.github.com> Date: Wed, 22 May 2024 15:30:34 +0530 Subject: [PATCH 4/5] Hulk deployment GA added (#805) * Hulk deployment GA added * Fix Path --- .github/workflows/hulk_deployment.yaml | 54 ++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/hulk_deployment.yaml diff --git a/.github/workflows/hulk_deployment.yaml b/.github/workflows/hulk_deployment.yaml new file mode 100644 index 000000000..c60377ab1 --- /dev/null +++ b/.github/workflows/hulk_deployment.yaml @@ -0,0 +1,54 @@ +name: Workflow For Release Branch + +on: + push: + branches: + - 'integrations_app_release_*' +jobs: + hulk_deploy: + name: Hulk Deploy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Push to dockerhub + uses: fylein/docker-release-action@master + id: generate-and-push-tag + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + IMAGE_NAME: fyle_integrations-app + + - name: Install kustomize + run: | + curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash + sudo mv kustomize /usr/local/bin/ + + - name: Clone another repository + uses: actions/checkout@v2 + with: + repository: ${{ vars.STAGING_DEPLOY_REPO }} + ref: master + path: ${{ vars.STAGING_DEPLOY_REPO }} + persist-credentials: false + token: ${{ secrets.DEPLOY_GIT_ACCESS_TOKEN }} + + + - name: Update Image Tag + run: | + NEW_TAG=${{ steps.generate-and-push-tag.outputs.new_tag }} + cd ${{ vars.STAGING_DEPLOY_REPO }}/${{ vars.STAGING_DEPLOY_DIR }}/hulk/integrations + kustomize edit set image docker.io/${{ secrets.DOCKERHUB_USERNAME }}/fyle_integrations-app=docker.io/${{ secrets.DOCKERHUB_USERNAME }}/fyle_integrations-app:$NEW_TAG + + - name: Commit and push changes + run: | + NEW_TAG=${{ steps.generate-and-push-tag.outputs.new_tag }} + cd ${{ vars.STAGING_DEPLOY_REPO }}/ + git config --global user.email "integrations@fylehq.com" + git config --global user.name "GitHub Actions" + git add . + git commit -m "Deployed fyle_integrations-app:$NEW_TAG" + git remote set-url origin https://x-access-token:${{ secrets.DEPLOY_GIT_ACCESS_TOKEN }}@github.com/${{ vars.STAGING_DEPLOY_REPO }} + git pull origin master + git push origin master From d83c8c1267d2dd663a1d6a252900c84e3d70cef5 Mon Sep 17 00:00:00 2001 From: ruuushhh <66899387+ruuushhh@users.noreply.github.com> Date: Wed, 22 May 2024 15:39:35 +0530 Subject: [PATCH 5/5] Fix hulk ga (#816) * Fix Hulk deployment GA * Fix Hulk deployment GA --- .github/workflows/hulk_deployment.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/hulk_deployment.yaml b/.github/workflows/hulk_deployment.yaml index c60377ab1..859cba47c 100644 --- a/.github/workflows/hulk_deployment.yaml +++ b/.github/workflows/hulk_deployment.yaml @@ -1,4 +1,4 @@ -name: Workflow For Release Branch +name: Deploy to Hulk on: push: @@ -6,12 +6,10 @@ on: - 'integrations_app_release_*' jobs: hulk_deploy: - name: Hulk Deploy runs-on: ubuntu-latest + environment: Staging steps: - uses: actions/checkout@v2 - with: - submodules: recursive - name: Push to dockerhub uses: fylein/docker-release-action@master id: generate-and-push-tag