From 23531037cfe2c0c36d93227501a0d810be6df0f8 Mon Sep 17 00:00:00 2001 From: Arne Dumarey Date: Wed, 25 Oct 2023 09:16:09 +0200 Subject: [PATCH] ci: add finish slack + rename new production --- .github/workflows/release.yml | 94 +++++++++++++++++++++++++++-------- 1 file changed, 73 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e0e13e0..0a903d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -242,17 +242,6 @@ jobs: CONFLUENCE_USERNAME: ${{ secrets.VBR_CONFLUENCE_USER }} CONFLUENCE_PASSWORD: ${{ secrets.VBR_CONFLUENCE_PASSWORD }} - # - name: Create Jira Release - # shell: bash - # run: ./packages/Be.Vlaanderen.Basisregisters.Build.Pipeline/Content/ci-jira.sh - # env: - # CONFLUENCE_TITLE: ${{ env.REPOSITORY_NAME }} - # CONFLUENCE_USERNAME: ${{ secrets.VBR_CONFLUENCE_USER }} - # CONFLUENCE_PASSWORD: ${{ secrets.VBR_CONFLUENCE_PASSWORD }} - # JIRA_PREFIX: OpsWeb - # JIRA_PROJECT: GAWR - # JIRA_VERSION: ${{ needs.release.outputs.version }} - push_images_to_test: if: needs.release.outputs.version != 'none' needs: [ release ] @@ -353,10 +342,10 @@ jobs: SEMVER: ${{ needs.release.outputs.version }} WORKSPACE: ${{ github.workspace }} - push_images_to_newproduction: + push_images_to_production: if: needs.release.outputs.version != 'none' needs: [ release ] - name: Push images to New Production + name: Push images to Production runs-on: ubuntu-latest strategy: matrix: @@ -364,14 +353,14 @@ jobs: 'dashboard' ] steps: - - name: Configure AWS credentials (New Production) + - name: Configure AWS credentials (Production) uses: aws-actions/configure-aws-credentials@v1-node16 with: aws-access-key-id: ${{ secrets.VBR_AWS_ACCESS_KEY_ID_NEWPRD }} aws-secret-access-key: ${{ secrets.VBR_AWS_SECRET_ACCESS_KEY_NEWPRD }} aws-region: ${{ secrets.VBR_AWS_REGION_PRD }} - - name: Login to Amazon ECR (New Production) + - name: Login to Amazon ECR (Production) uses: aws-actions/amazon-ecr-login@v1.5.3 # Download artifact @@ -391,7 +380,7 @@ jobs: env: IMAGE: ${{ matrix.image }} - - name: Push artifacts to ECR New Production + - name: Push artifacts to ECR Production shell: bash run: | echo $IMAGE:$SEMVER @@ -460,6 +449,27 @@ jobs: echo Status: ${{ steps.awscurl-polling-action.outputs.status }} echo ${{ steps.awscurl-polling-action.outputs.final-message }} + deploy_to_test_finish_slack: + if: github.repository_owner == 'Informatievlaanderen' + needs: [ deploy_to_test ] + name: Deploy to test finished + runs-on: ubuntu-latest + + steps: + - name: Parse repository name + run: echo REPOSITORY_NAME=$(echo ""$GITHUB_REPOSITORY"" | awk -F / '{print $2}' | sed -e ""s/:refs//"") >> $GITHUB_ENV + shell: bash + + - name: Notify deployment finished + uses: slackapi/slack-github-action@v1.23.0 + with: + channel-id: '#team-dinosaur-dev' + slack-message: Deployment of ops-web to test has finished + env: + SLACK_BOT_TOKEN: ${{ secrets.VBR_SLACK_BOT_TOKEN }} + SLACK_CHANNEL: ${{ secrets.VBR_NOTIFIER_CHANNEL_NAME }} + REPOSITORY_NAME: ${{ env.REPOSITORY_NAME }} + deploy_to_staging_start_slack: if: github.repository_owner == 'Informatievlaanderen' needs: [ push_images_to_staging, release ] @@ -515,10 +525,31 @@ jobs: echo Status: ${{ steps.awscurl-polling-action.outputs.status }} echo ${{ steps.awscurl-polling-action.outputs.final-message }} - deploy_to_newproduction_start_slack: + deploy_to_staging_finish_slack: if: github.repository_owner == 'Informatievlaanderen' - needs: [ push_images_to_newproduction, release ] - name: Deploy to new production started + needs: [ deploy_to_staging ] + name: Deploy to staging finished + runs-on: ubuntu-latest + + steps: + - name: Parse repository name + run: echo REPOSITORY_NAME=$(echo ""$GITHUB_REPOSITORY"" | awk -F / '{print $2}' | sed -e ""s/:refs//"") >> $GITHUB_ENV + shell: bash + + - name: Notify deployment finished + uses: slackapi/slack-github-action@v1.23.0 + with: + channel-id: '#team-dinosaur-dev' + slack-message: Deployment of ops-web to staging has finished + env: + SLACK_BOT_TOKEN: ${{ secrets.VBR_SLACK_BOT_TOKEN }} + SLACK_CHANNEL: ${{ secrets.VBR_NOTIFIER_CHANNEL_NAME }} + REPOSITORY_NAME: ${{ env.REPOSITORY_NAME }} + + deploy_to_production_start_slack: + if: github.repository_owner == 'Informatievlaanderen' + needs: [ push_images_to_production, release ] + name: Deploy to production started environment: newprd runs-on: ubuntu-latest @@ -537,9 +568,9 @@ jobs: SLACK_CHANNEL: ${{ secrets.VBR_NOTIFIER_CHANNEL_NAME }} REPOSITORY_NAME: ${{ env.REPOSITORY_NAME }} - deploy_to_newproduction: + deploy_to_production: if: github.repository_owner == 'Informatievlaanderen' - needs: [ deploy_to_newproduction_start_slack, release ] + needs: [ deploy_to_production_start_slack, release ] name: Deploy to new production runs-on: ubuntu-latest strategy: @@ -569,3 +600,24 @@ jobs: echo build-uuid: ${{ steps.awscurl-polling-action.outputs.build-uuid }} echo Status: ${{ steps.awscurl-polling-action.outputs.status }} echo ${{ steps.awscurl-polling-action.outputs.final-message }} + + deploy_to_production_finish_slack: + if: github.repository_owner == 'Informatievlaanderen' + needs: [ deploy_to_production ] + name: Deploy to production finished + runs-on: ubuntu-latest + + steps: + - name: Parse repository name + run: echo REPOSITORY_NAME=$(echo ""$GITHUB_REPOSITORY"" | awk -F / '{print $2}' | sed -e ""s/:refs//"") >> $GITHUB_ENV + shell: bash + + - name: Notify deployment finished + uses: slackapi/slack-github-action@v1.23.0 + with: + channel-id: '#team-dinosaur-dev' + slack-message: Deployment of ops-web to production has finished + env: + SLACK_BOT_TOKEN: ${{ secrets.VBR_SLACK_BOT_TOKEN }} + SLACK_CHANNEL: ${{ secrets.VBR_NOTIFIER_CHANNEL_NAME }} + REPOSITORY_NAME: ${{ env.REPOSITORY_NAME }}