Skip to content

Commit eadad72

Browse files
committed
VED-812: Read outputs from Terraform. Some tidying up.
1 parent b87043b commit eadad72

2 files changed

Lines changed: 36 additions & 38 deletions

File tree

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

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,17 @@ on:
3333
type: string
3434
description: Set the sub environment name e.g. pr-xxx, or green/blue in higher environments
3535

36+
env:
37+
APIGEE_ENVIRONMENT: ${{ inputs.apigee_environment }}
38+
BACKEND_ENVIRONMENT: ${{ inputs.environment }}
39+
BACKEND_SUB_ENVIRONMENT: ${{ inputs.sub_environment }}
40+
3641
jobs:
3742
e2e-tests:
3843
runs-on: ubuntu-latest
3944
environment:
4045
name: ${{ inputs.environment }}
4146
env: # Sonarcloud - do not allow direct usage of untrusted data
42-
APIGEE_ENVIRONMENT: ${{ inputs.apigee_environment }}
43-
BACKEND_ENVIRONMENT: ${{ inputs.environment }}
44-
BACKEND_SUB_ENVIRONMENT: ${{ inputs.sub_environment }}
4547
APIGEE_USERNAME: ${{ vars.APIGEE_USERNAME }}
4648
permissions:
4749
id-token: write
@@ -64,6 +66,15 @@ jobs:
6466
working-directory: terraform
6567
run: make init apigee_environment=$APIGEE_ENVIRONMENT environment=$BACKEND_ENVIRONMENT sub_environment=$BACKEND_SUB_ENVIRONMENT
6668

69+
- name: Read Terraform outputs
70+
working-directory: terraform
71+
run: |
72+
echo "IMMS_DELTA_TABLE_NAME=$(make -s output name=imms_delta_table_name)" >> $GITHUB_ENV
73+
echo "AWS_DOMAIN_NAME=$(make -s output name=service_domain_name)" >> $GITHUB_ENV
74+
echo "DYNAMODB_TABLE_NAME=$(make -s output name=dynamodb_table_name)" >> $GITHUB_ENV
75+
echo "AWS_SQS_QUEUE_NAME=$(make -s output name=aws_sqs_queue_name)" >> $GITHUB_ENV
76+
echo "AWS_SNS_TOPIC_NAME=$(make -s output name=aws_sns_topic_name)" >> $GITHUB_ENV
77+
6778
- name: Install poetry
6879
run: pip install poetry==2.1.4
6980

@@ -99,29 +110,20 @@ jobs:
99110
100111
- name: Run e2e tests
101112
working-directory: e2e
113+
env:
114+
SOURCE_COMMIT_ID: ${{ github.sha }}
115+
# STATUS_API_KEY: ${{ secrets.STATUS_API_KEY }}
102116
run: |
103-
export PROXY_NAME=immunisation-fhir-api-internal-dev
117+
# TODO - handle PR deployments
104118
export SERVICE_BASE_PATH=immunisation-fhir-api/FHIR/R4
105119
106-
# export IMMS_DELTA_TABLE_NAME=imms-internal-dev-delta
107-
# export AWS_DOMAIN_NAME=internal-dev.imms.dev.vds.platform.nhs.uk
108-
# export DYNAMODB_TABLE_NAME=imms-internal-dev-imms-events
109-
# export AWS_SQS_QUEUE_NAME=imms-internal-dev-delta-dlq
110-
# export AWS_SNS_TOPIC_NAME=imms-internal-dev-delta-sns
111-
112-
# poetry run python -m unittest -c -v
113-
make run
120+
poetry run python -m unittest -c -v
114121
115122
batch-e2e-tests:
116123
needs: [e2e-tests]
117124
runs-on: ubuntu-latest
118125
environment:
119126
name: ${{ inputs.environment }}
120-
env: # Sonarcloud - do not allow direct usage of untrusted data
121-
APIGEE_ENVIRONMENT: ${{ inputs.apigee_environment }}
122-
BACKEND_ENVIRONMENT: ${{ inputs.environment }}
123-
BACKEND_SUB_ENVIRONMENT: ${{ inputs.sub_environment }}
124-
APIGEE_USERNAME: ${{ vars.APIGEE_USERNAME }}
125127
permissions:
126128
id-token: write
127129
contents: read
@@ -151,8 +153,4 @@ jobs:
151153
working-directory: e2e_batch
152154
env:
153155
ENVIRONMENT: ${{ inputs.sub_environment }}
154-
run: |
155-
# export PROXY_NAME=immunisation-fhir-api-internal-dev
156-
# export SERVICE_BASE_PATH=immunisation-fhir-api/FHIR/R4
157-
158-
poetry run python -m unittest -c -v
156+
run: poetry run python -m unittest -c -v

terraform/.terraform.lock.hcl

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)