Skip to content

Commit

Permalink
ci: add finish slack + rename new production
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneD authored Oct 25, 2023
1 parent 5f0b063 commit 2353103
Showing 1 changed file with 73 additions and 21 deletions.
94 changes: 73 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down Expand Up @@ -353,25 +342,25 @@ 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:
image: [
'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/[email protected]

# Download artifact
Expand All @@ -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
Expand Down Expand Up @@ -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/[email protected]
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 ]
Expand Down Expand Up @@ -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/[email protected]
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

Expand All @@ -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:
Expand Down Expand Up @@ -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/[email protected]
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 }}

0 comments on commit 2353103

Please sign in to comment.