Skip to content

Commit 6a0d35a

Browse files
authored
VED-811 (Child of VED-720) Refactor PR and Release pipelines to move to GH Actions (#855)
1 parent 6c634fc commit 6a0d35a

13 files changed

+128
-572
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: 2 additions & 2 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
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: 11 additions & 4 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
@@ -173,10 +184,6 @@ jobs:
173184
echo "::add-mask::$token"
174185
echo "APIGEE_ACCESS_TOKEN=$token" >> $GITHUB_ENV
175186
176-
- name: Run proxy deployment e2e test suite
177-
working-directory: e2e
178-
run: poetry run python -m unittest test_deployment
179-
180187
- name: Run proxy e2e test suite
181188
if: ${{ vars.RUN_PROXY_E2E_TESTS == 'true' }}
182189
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)