Skip to content

Commit dfb4db4

Browse files
committed
TEMP
1 parent bd3880c commit dfb4db4

File tree

2 files changed

+109
-104
lines changed

2 files changed

+109
-104
lines changed

.github/workflows/actions/smoke-test/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ runs:
4646
echo "::add-mask::$SUPPORT_PASSWORD"
4747
echo "SUPPORT_PASSWORD=$SUPPORT_PASSWORD" >> $GITHUB_OUTPUT
4848
49+
- name: Setup tmate session
50+
uses: mxschmitt/action-tmate@v3
51+
4952
- name: Run deployment smoke test
5053
shell: bash
5154
run: bin/smoke

.github/workflows/build-and-deploy.yml

Lines changed: 106 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy
33
on:
44
push:
55
branches:
6-
- main
6+
- debug-smoke-test
77

88
pull_request:
99
branches:
@@ -31,46 +31,46 @@ env:
3131
CONTAINER_REGISTRY: ghcr.io
3232

3333
jobs:
34-
docker:
35-
name: Docker build and push
36-
if: contains(github.event.pull_request.labels.*.name, 'deploy') || github.event_name != 'pull_request'
37-
runs-on: ubuntu-latest
38-
outputs:
39-
docker_image: ${{ steps.dockerimage.outputs.docker_image_tag }}
40-
steps:
41-
- uses: actions/checkout@v4
42-
- uses: ./.github/workflows/actions/build-docker
43-
id: dockerimage
44-
with:
45-
github_username: ${{ github.actor }}
46-
github_token: ${{ secrets.GITHUB_TOKEN }}
47-
48-
deploy_review:
49-
name: Deploy to review environment
50-
concurrency: deploy_review_${{ github.event.pull_request.number }}
51-
needs: [docker]
52-
runs-on: ubuntu-latest
53-
if: contains(github.event.pull_request.labels.*.name, 'deploy')
54-
environment:
55-
name: review
56-
57-
steps:
58-
- uses: actions/checkout@v4
59-
- uses: ./.github/workflows/actions/deploy
60-
id: deploy
61-
with:
62-
environment: review
63-
docker_image: ${{ needs.docker.outputs.docker_image }}
64-
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
65-
arm-access-key: ${{ secrets.ARM_ACCESS_KEY }}
66-
pr-id: ${{ github.event.pull_request.number }}
67-
68-
- name: Post sticky pull request comment
69-
if: github.event_name == 'pull_request'
70-
uses: marocchino/sticky-pull-request-comment@v2
71-
with:
72-
message: |
73-
AKS review app deployed to https://find-a-lost-trn-review-pr-${{ github.event.pull_request.number }}.test.teacherservices.cloud
34+
# docker:
35+
# name: Docker build and push
36+
# if: contains(github.event.pull_request.labels.*.name, 'deploy') || github.event_name != 'pull_request'
37+
# runs-on: ubuntu-latest
38+
# outputs:
39+
# docker_image: ${{ steps.dockerimage.outputs.docker_image_tag }}
40+
# steps:
41+
# - uses: actions/checkout@v4
42+
# - uses: ./.github/workflows/actions/build-docker
43+
# id: dockerimage
44+
# with:
45+
# github_username: ${{ github.actor }}
46+
# github_token: ${{ secrets.GITHUB_TOKEN }}
47+
48+
# deploy_review:
49+
# name: Deploy to review environment
50+
# concurrency: deploy_review_${{ github.event.pull_request.number }}
51+
# needs: [docker]
52+
# runs-on: ubuntu-latest
53+
# if: contains(github.event.pull_request.labels.*.name, 'deploy')
54+
# environment:
55+
# name: review
56+
57+
# steps:
58+
# - uses: actions/checkout@v4
59+
# - uses: ./.github/workflows/actions/deploy
60+
# id: deploy
61+
# with:
62+
# environment: review
63+
# docker_image: ${{ needs.docker.outputs.docker_image }}
64+
# azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
65+
# arm-access-key: ${{ secrets.ARM_ACCESS_KEY }}
66+
# pr-id: ${{ github.event.pull_request.number }}
67+
68+
# - name: Post sticky pull request comment
69+
# if: github.event_name == 'pull_request'
70+
# uses: marocchino/sticky-pull-request-comment@v2
71+
# with:
72+
# message: |
73+
# AKS review app deployed to https://find-a-lost-trn-review-pr-${{ github.event.pull_request.number }}.test.teacherservices.cloud
7474

7575
set_matrix:
7676
name: Set deployment matrix
@@ -84,7 +84,8 @@ jobs:
8484
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
8585
DEPLOYMENT_MATRIX="{ 'environment': ['${{ github.event.inputs.environment }}'] }"
8686
else
87-
DEPLOYMENT_MATRIX="{ 'environment': ['development', 'test', 'preproduction'] }"
87+
DEPLOYMENT_MATRIX="{ 'environment': ['preproduction'] }"
88+
# DEPLOYMENT_MATRIX="{ 'environment': ['development', 'test', 'preproduction'] }"
8889
fi
8990
echo "deployment_matrix=$DEPLOYMENT_MATRIX" >> $GITHUB_OUTPUT
9091
@@ -93,7 +94,8 @@ jobs:
9394
runs-on: ubuntu-latest
9495
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
9596
concurrency: deploy_${{ matrix.environment }}
96-
needs: [docker, set_matrix]
97+
needs: [set_matrix]
98+
# needs: [docker, set_matrix]
9799
strategy:
98100
fail-fast: false # this is necessary to prevent early terminiation of terraform deployments that will result in tfstate locks
99101
max-parallel: 3
@@ -120,71 +122,71 @@ jobs:
120122
echo "::add-mask::$SLACK_WEBHOOK"
121123
echo "SLACK_WEBHOOK=$SLACK_WEBHOOK" >> $GITHUB_OUTPUT
122124
123-
- uses: ./.github/workflows/actions/deploy
124-
id: deploy
125-
with:
126-
environment: ${{ matrix.environment }}
127-
docker_image: ${{ needs.docker.outputs.docker_image }}
128-
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
129-
arm-access-key: ${{ secrets.ARM_ACCESS_KEY }}
125+
# - uses: ./.github/workflows/actions/deploy
126+
# id: deploy
127+
# with:
128+
# environment: ${{ matrix.environment }}
129+
# docker_image: ${{ needs.docker.outputs.docker_image }}
130+
# azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
131+
# arm-access-key: ${{ secrets.ARM_ACCESS_KEY }}
130132

131133
- uses: ./.github/workflows/actions/smoke-test
132134
id: smoke-test
133135
with:
134136
environment: ${{ matrix.environment }}
135137
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
136138

137-
- name: Slack Notification
138-
if: failure()
139-
uses: rtCamp/action-slack-notify@master
140-
env:
141-
SLACK_COLOR: failure
142-
SLACK_TITLE: Failure deploying release to ${{ matrix.environment }}
143-
SLACK_MESSAGE: Failure deploying release to ${{ matrix.environment }} - Docker tag ${{ needs.docker.outputs.docker_image }}
144-
SLACK_WEBHOOK: ${{ steps.keyvault-yaml-secret.outputs.SLACK_WEBHOOK }}
145-
146-
deploy_production:
147-
name: Deploy to production environment
148-
runs-on: ubuntu-latest
149-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
150-
environment:
151-
name: production
152-
url: ${{ steps.deploy.outputs.environment_url }}
153-
concurrency: deploy_production
154-
needs: [docker, deploy_nonprod]
155-
156-
outputs:
157-
environment_url: ${{ steps.deploy.outputs.environment_url }}
158-
159-
steps:
160-
- uses: actions/checkout@v4
161-
162-
- uses: azure/login@v2
163-
with:
164-
creds: ${{ secrets.AZURE_CREDENTIALS }}
165-
166-
- name: Fetch secrets from key vault
167-
uses: azure/CLI@v2
168-
id: keyvault-yaml-secret
169-
with:
170-
inlineScript: |
171-
SLACK_WEBHOOK=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.INF_KEY_VAULT }}" --query "value" -o tsv)
172-
echo "::add-mask::$SLACK_WEBHOOK"
173-
echo "SLACK_WEBHOOK=$SLACK_WEBHOOK" >> $GITHUB_OUTPUT
174-
175-
- uses: ./.github/workflows/actions/deploy
176-
id: deploy
177-
with:
178-
environment: production
179-
docker_image: ${{ needs.docker.outputs.docker_image }}
180-
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
181-
arm-access-key: ${{ secrets.ARM_ACCESS_KEY }}
182-
183-
- name: Slack Notification
184-
if: failure()
185-
uses: rtCamp/action-slack-notify@master
186-
env:
187-
SLACK_COLOR: failure
188-
SLACK_TITLE: Failure deploying release to production
189-
SLACK_MESSAGE: Failure deploying release to production - Docker tag ${{ needs.docker.outputs.docker_image }}
190-
SLACK_WEBHOOK: ${{ steps.keyvault-yaml-secret.outputs.SLACK_WEBHOOK }}
139+
# - name: Slack Notification
140+
# if: failure()
141+
# uses: rtCamp/action-slack-notify@master
142+
# env:
143+
# SLACK_COLOR: failure
144+
# SLACK_TITLE: Failure deploying release to ${{ matrix.environment }}
145+
# SLACK_MESSAGE: Failure deploying release to ${{ matrix.environment }} - Docker tag ${{ needs.docker.outputs.docker_image }}
146+
# SLACK_WEBHOOK: ${{ steps.keyvault-yaml-secret.outputs.SLACK_WEBHOOK }}
147+
148+
# deploy_production:
149+
# name: Deploy to production environment
150+
# runs-on: ubuntu-latest
151+
# if: github.ref == 'refs/heads/main' && github.event_name == 'push'
152+
# environment:
153+
# name: production
154+
# url: ${{ steps.deploy.outputs.environment_url }}
155+
# concurrency: deploy_production
156+
# needs: [docker, deploy_nonprod]
157+
158+
# outputs:
159+
# environment_url: ${{ steps.deploy.outputs.environment_url }}
160+
161+
# steps:
162+
# - uses: actions/checkout@v4
163+
164+
# - uses: azure/login@v2
165+
# with:
166+
# creds: ${{ secrets.AZURE_CREDENTIALS }}
167+
168+
# - name: Fetch secrets from key vault
169+
# uses: azure/CLI@v2
170+
# id: keyvault-yaml-secret
171+
# with:
172+
# inlineScript: |
173+
# SLACK_WEBHOOK=$(az keyvault secret show --name "SLACK-WEBHOOK" --vault-name "${{ secrets.INF_KEY_VAULT }}" --query "value" -o tsv)
174+
# echo "::add-mask::$SLACK_WEBHOOK"
175+
# echo "SLACK_WEBHOOK=$SLACK_WEBHOOK" >> $GITHUB_OUTPUT
176+
177+
# - uses: ./.github/workflows/actions/deploy
178+
# id: deploy
179+
# with:
180+
# environment: production
181+
# docker_image: ${{ needs.docker.outputs.docker_image }}
182+
# azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
183+
# arm-access-key: ${{ secrets.ARM_ACCESS_KEY }}
184+
185+
# - name: Slack Notification
186+
# if: failure()
187+
# uses: rtCamp/action-slack-notify@master
188+
# env:
189+
# SLACK_COLOR: failure
190+
# SLACK_TITLE: Failure deploying release to production
191+
# SLACK_MESSAGE: Failure deploying release to production - Docker tag ${{ needs.docker.outputs.docker_image }}
192+
# SLACK_WEBHOOK: ${{ steps.keyvault-yaml-secret.outputs.SLACK_WEBHOOK }}

0 commit comments

Comments
 (0)