Skip to content

Commit 64ffa56

Browse files
authored
Merge branch 'master' into bugfix/VED-872-improve-given-name-validation
2 parents ca3c8a9 + a2a06b6 commit 64ffa56

13 files changed

+136
-579
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Continuous Deployment Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
deploy-internal-dev-backend:
10+
uses: ./.github/workflows/deploy-backend.yml
11+
with:
12+
apigee_environment: internal-dev
13+
create_mns_subscription: true
14+
environment: dev
15+
sub_environment: internal-dev
16+
17+
run-internal-dev-sandbox-tests:
18+
# Technically the first step is not a pre-requisite - sandbox backend deployment is handled by APIM
19+
# Stipulating this condition simply makes it more likely the environment will be ready when tests are invoked
20+
needs: [deploy-internal-dev-backend]
21+
uses: ./.github/workflows/run-e2e-tests.yml
22+
with:
23+
apigee_environment: internal-dev-sandbox
24+
environment: dev
25+
sub_environment: internal-dev-sandbox
26+
secrets:
27+
APIGEE_PASSWORD: ${{ secrets.APIGEE_PASSWORD }}
28+
APIGEE_BASIC_AUTH_TOKEN: ${{ secrets.APIGEE_BASIC_AUTH_TOKEN }}
29+
APIGEE_OTP_KEY: ${{ secrets.APIGEE_OTP_KEY }}
30+
STATUS_API_KEY: ${{ secrets.STATUS_API_KEY }}
31+
32+
run-sandbox-tests:
33+
needs: [run-internal-dev-sandbox-tests]
34+
uses: ./.github/workflows/run-e2e-tests.yml
35+
with:
36+
apigee_environment: sandbox
37+
environment: dev
38+
sub_environment: sandbox
39+
secrets:
40+
APIGEE_PASSWORD: ${{ secrets.APIGEE_PASSWORD }}
41+
APIGEE_BASIC_AUTH_TOKEN: ${{ secrets.APIGEE_BASIC_AUTH_TOKEN }}
42+
APIGEE_OTP_KEY: ${{ secrets.APIGEE_OTP_KEY }}
43+
STATUS_API_KEY: ${{ secrets.STATUS_API_KEY }}
44+
45+
run-internal-dev-tests:
46+
needs: [deploy-internal-dev-backend]
47+
uses: ./.github/workflows/run-e2e-tests.yml
48+
with:
49+
apigee_environment: internal-dev
50+
environment: dev
51+
sub_environment: internal-dev
52+
secrets:
53+
APIGEE_PASSWORD: ${{ secrets.APIGEE_PASSWORD }}
54+
APIGEE_BASIC_AUTH_TOKEN: ${{ secrets.APIGEE_BASIC_AUTH_TOKEN }}
55+
APIGEE_OTP_KEY: ${{ secrets.APIGEE_OTP_KEY }}
56+
STATUS_API_KEY: ${{ secrets.STATUS_API_KEY }}
57+
58+
deploy-higher-dev-envs:
59+
needs: [run-internal-dev-tests]
60+
strategy:
61+
matrix:
62+
sub_environment_name: [ref, int]
63+
uses: ./.github/workflows/deploy-backend.yml
64+
with:
65+
apigee_environment: ${{ matrix.sub_environment_name }}
66+
create_mns_subscription: true
67+
environment: dev
68+
sub_environment: ${{ matrix.sub_environment_name }}
69+
70+
run-higher-dev-env-tests:
71+
needs: [deploy-higher-dev-envs]
72+
strategy:
73+
matrix:
74+
sub_environment_name: [ref, int]
75+
uses: ./.github/workflows/run-e2e-tests.yml
76+
with:
77+
apigee_environment: ${{ matrix.sub_environment_name }}
78+
environment: dev
79+
sub_environment: ${{ matrix.sub_environment_name }}
80+
secrets:
81+
APIGEE_PASSWORD: ${{ secrets.APIGEE_PASSWORD }}
82+
APIGEE_BASIC_AUTH_TOKEN: ${{ secrets.APIGEE_BASIC_AUTH_TOKEN }}
83+
APIGEE_OTP_KEY: ${{ secrets.APIGEE_OTP_KEY }}
84+
STATUS_API_KEY: ${{ secrets.STATUS_API_KEY }}

.github/workflows/deploy-backend.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ on:
2727
- ref
2828
- prod
2929
create_mns_subscription:
30-
description: Create an MNS Subscription. Only available in dev
30+
description: Create an MNS Subscription programatically. Only available in AWS dev
3131
required: false
3232
type: boolean
3333
default: true
3434
environment:
35-
type: string
35+
type: choice
3636
description: Select the backend environment
3737
options:
3838
- dev
@@ -82,7 +82,7 @@ jobs:
8282
- name: Save Terraform Plan
8383
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
8484
with:
85-
name: tfplan
85+
name: ${{ env.ENVIRONMENT }}-${{ env.SUB_ENVIRONMENT }}-tfplan
8686
path: terraform/tfplan
8787

8888
terraform-apply:
@@ -107,7 +107,7 @@ jobs:
107107
- name: Retrieve Terraform Plan
108108
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
109109
with:
110-
name: tfplan
110+
name: ${{ env.ENVIRONMENT }}-${{ env.SUB_ENVIRONMENT }}-tfplan
111111
path: terraform
112112

113113
- name: Terraform Init
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: PR Deploy and Test
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
deploy-pr-backend:
9+
uses: ./.github/workflows/deploy-backend.yml
10+
with:
11+
apigee_environment: internal-dev
12+
create_mns_subscription: true
13+
environment: dev
14+
sub_environment: pr-${{github.event.pull_request.number}}
15+
16+
run-e2e-tests:
17+
needs: [deploy-pr-backend]
18+
strategy:
19+
matrix:
20+
apigee_environment_name: [internal-dev, internal-dev-sandbox]
21+
uses: ./.github/workflows/run-e2e-tests.yml
22+
with:
23+
apigee_environment: ${{ matrix.apigee_environment_name }}
24+
environment: dev
25+
sub_environment: pr-${{github.event.pull_request.number}}
26+
secrets:
27+
APIGEE_PASSWORD: ${{ secrets.APIGEE_PASSWORD }}
28+
APIGEE_BASIC_AUTH_TOKEN: ${{ secrets.APIGEE_BASIC_AUTH_TOKEN }}
29+
APIGEE_OTP_KEY: ${{ secrets.APIGEE_OTP_KEY }}
30+
STATUS_API_KEY: ${{ secrets.STATUS_API_KEY }}

.github/workflows/run-e2e-tests.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,24 @@ on:
1212
sub_environment:
1313
required: true
1414
type: string
15+
secrets:
16+
APIGEE_PASSWORD:
17+
required: true
18+
APIGEE_BASIC_AUTH_TOKEN:
19+
required: true
20+
APIGEE_OTP_KEY:
21+
required: true
22+
STATUS_API_KEY:
23+
required: true
1524
workflow_dispatch:
1625
inputs:
1726
apigee_environment:
1827
type: choice
1928
description: Select the Apigee proxy environment
2029
options:
2130
- internal-dev
31+
- internal-dev-sandbox
32+
- sandbox
2233
- int
2334
- ref
2435
- prod
@@ -102,34 +113,35 @@ jobs:
102113
environment: ${{ inputs.apigee_environment }}
103114
env:
104115
APIGEE_USERNAME: ${{ vars.APIGEE_USERNAME }}
116+
TF_OUTPUTS_REQUIRED: ${{ vars.RUN_FULL_E2E_TESTS == 'true' || vars.RUN_PROXY_E2E_TESTS == 'true' }}
105117
steps:
106118
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
107119

108120
- name: Connect to AWS
109-
if: ${{ vars.RUN_FULL_E2E_TESTS == 'true' }}
121+
if: ${{ env.TF_OUTPUTS_REQUIRED == 'true' }}
110122
uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8
111123
with:
112124
aws-region: eu-west-2
113125
role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/auto-ops
114126
role-session-name: github-actions
115127

116128
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd
117-
if: ${{ vars.RUN_FULL_E2E_TESTS == 'true' }}
129+
if: ${{ env.TF_OUTPUTS_REQUIRED == 'true' }}
118130
with:
119131
terraform_version: "1.12.2"
120132

121133
- name: Terraform Init
122-
if: ${{ vars.RUN_FULL_E2E_TESTS == 'true' }}
134+
if: ${{ env.TF_OUTPUTS_REQUIRED == 'true' }}
123135
working-directory: terraform
124136
run: make init
125137

126138
- name: Set Terraform workspace
127-
if: ${{ vars.RUN_FULL_E2E_TESTS == 'true' }}
139+
if: ${{ env.TF_OUTPUTS_REQUIRED == 'true' }}
128140
working-directory: terraform
129141
run: make workspace
130142

131143
- name: Read Terraform outputs
132-
if: ${{ vars.RUN_FULL_E2E_TESTS == 'true' }}
144+
if: ${{ env.TF_OUTPUTS_REQUIRED == 'true' }}
133145
working-directory: terraform
134146
run: |
135147
echo "IMMS_DELTA_TABLE_NAME=$(make -s output name=imms_delta_table_name)" >> $GITHUB_ENV
@@ -173,10 +185,6 @@ jobs:
173185
echo "::add-mask::$token"
174186
echo "APIGEE_ACCESS_TOKEN=$token" >> $GITHUB_ENV
175187
176-
- name: Run proxy deployment e2e test suite
177-
working-directory: e2e
178-
run: poetry run python -m unittest test_deployment
179-
180188
- name: Run proxy e2e test suite
181189
if: ${{ vars.RUN_PROXY_E2E_TESTS == 'true' }}
182190
working-directory: e2e

Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ build-proxy:
3636
scripts/build_proxy.sh
3737

3838
#Files to loop over in release
39-
# VED-811: remove everything except for proxy related files as we move to Github Actions for backend deployment
40-
_dist_include="poetry.toml Makefile build/. specification sandbox terraform scripts"
39+
_dist_include="poetry.toml Makefile build/. specification sandbox scripts"
4140

4241
#Create /dist/ sub-directory and copy files into directory
4342
#Ensure full dir structure is preserved for Lambdas
4443
release: clean publish build-proxy
4544
mkdir -p dist
4645
for f in $(_dist_include); do cp -r $$f dist; done
47-
for f in $(PYTHON_PROJECT_DIRS); do cp --parents -r $$f dist; done
4846
cp ecs-proxies-deploy.yml dist/ecs-deploy-sandbox.yml
4947
cp ecs-proxies-deploy.yml dist/ecs-deploy-internal-qa-sandbox.yml
5048
cp ecs-proxies-deploy.yml dist/ecs-deploy-internal-dev-sandbox.yml

azure/azure-pr-pipeline.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,7 @@ extends:
3636
- environment: internal-dev
3737
jinja_templates:
3838
DOMAIN_ENDPOINT: https://pr-${{ variables.pr_number }}.imms.dev.vds.platform.nhs.uk
39-
post_deploy:
40-
- template: ./templates/post-deploy.yml
41-
parameters:
42-
aws_account_type: "dev"
4339
- environment: internal-dev-sandbox
4440
proxy_path: sandbox
4541
jinja_templates:
4642
DOMAIN_ENDPOINT: just-dummy-value-for-successful-build
47-
post_deploy:
48-
- template: ./templates/post-deploy.yml
49-
parameters:
50-
aws_account_type: "dev"
51-
subscribe_to_mns: false

azure/azure-prod-release-pipeline.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

azure/azure-release-pipeline.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,10 @@ extends:
3434
- environment: internal-dev
3535
jinja_templates:
3636
DOMAIN_ENDPOINT: https://internal-dev.imms.dev.vds.platform.nhs.uk
37-
post_deploy:
38-
- template: ./templates/post-deploy.yml
39-
parameters:
40-
aws_account_type: "dev"
4137
- environment: internal-dev-sandbox
4238
proxy_path: sandbox
4339
jinja_templates:
4440
DOMAIN_ENDPOINT: just-dummy-value-for-successful-build
45-
post_deploy:
46-
- template: ./templates/post-deploy.yml
47-
parameters:
48-
aws_account_type: "dev"
49-
subscribe_to_mns: false
5041
- environment: sandbox
5142
proxy_path: sandbox
5243
jinja_templates:
@@ -56,19 +47,10 @@ extends:
5647
- environment: ref
5748
depends_on:
5849
- internal_dev
59-
- internal_dev_sandbox
6050
jinja_templates:
6151
DOMAIN_ENDPOINT: https://ref.imms.dev.vds.platform.nhs.uk
62-
post_deploy:
63-
- template: ./templates/post-deploy.yml
64-
parameters:
65-
aws_account_type: "dev"
6652
- environment: int
6753
depends_on:
6854
- internal_dev
6955
jinja_templates:
7056
DOMAIN_ENDPOINT: https://int.imms.dev.vds.platform.nhs.uk
71-
post_deploy:
72-
- template: ./templates/post-deploy.yml
73-
parameters:
74-
aws_account_type: "dev"

azure/templates/deploy-manual-approval.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)