generated from dfds/aws-modules-template
-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (57 loc) · 1.88 KB
/
qa-down.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Teardown QA instance
on:
schedule:
- cron: "30 17 * * 5" # At 17.30 every Friday
workflow_dispatch:
concurrency: terraform_qa
defaults:
run:
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_BLUEPRINTS_QA_DEPLOY_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_BLUEPRINTS_QA_DEPLOY_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-central-1
jobs:
qa-env:
runs-on: ubuntu-latest
container:
image: dfdsdk/python-pipeline:0.0.4
steps:
- name: Check environment variables
run: bash -c '[[ -z $AWS_ACCESS_KEY_ID || -z $AWS_SECRET_ACCESS_KEY ]] && exit 1 || true'
- name: Send alert if job fails
if: failure()
uses: dfds/shared-workflows/.github/actions/automation-slack-notifier@master
with:
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
slack_message: Test environment variables failed.
qa-down:
runs-on: ubuntu-latest
needs: qa-env
container:
image: dfdsdk/python-pipeline:0.0.4
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Terraform Init
id: init
run: terraform init
working-directory: tests/qa
- name: Terraform Validate
id: validate
run: terraform validate -no-color
working-directory: tests/qa
- name: Terraform Destroy
id: destroy
run: terraform destroy -input=false -auto-approve
working-directory: tests/qa
- name: Cleanup CloudWatch Log Groups
id: cloudwatch_log_groups
run: ./cloudwatch_log_groups.sh
working-directory: tests/qa
- name: Send alert if job fails
if: failure()
uses: dfds/shared-workflows/.github/actions/automation-slack-notifier@master
with:
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
slack_message: Teardown QA environment failed.