Skip to content

Commit 2240afd

Browse files
committed
Fix tf dockerfile path issues and add mns step
1 parent f95451b commit 2240afd

File tree

6 files changed

+39
-16
lines changed

6 files changed

+39
-16
lines changed

.github/workflows/deploy-backend.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
apigee_environment:
77
required: true
88
type: string
9+
create_mns_subscription:
10+
required: false
11+
type: boolean
12+
default: true
913
environment:
1014
required: true
1115
type: string
@@ -19,6 +23,11 @@ on:
1923
description: Select the Apigee proxy environment
2024
options:
2125
- internal-dev # Add rest later
26+
create_mns_subscription:
27+
description: Create an MNS Subscription. Only available in dev
28+
required: false
29+
type: boolean
30+
default: true
2231
environment:
2332
type: string
2433
description: Select the backend environment
@@ -93,7 +102,24 @@ jobs:
93102
- name: Terraform Apply
94103
working-directory: ${{ vars.TERRAFORM_DIR_PATH }}
95104
run: make apply apigee_environment=${{ inputs.apigee_environment }} environment=${{ inputs.environment }} sub_environment=${{ inputs.sub_environment }}
96-
# TODO - use a saved plan from the plan step
105+
106+
- name: Install poetry
107+
if: ${{ inputs.environment == 'dev' && inputs.create_mns_subscription }}
108+
run: pip install poetry==2.1.4
109+
110+
- uses: actions/setup-python@v5
111+
if: ${{ inputs.environment == 'dev' && inputs.create_mns_subscription }}
112+
with:
113+
python-version: 3.11
114+
cache: 'poetry'
115+
116+
- name: Create MNS Subscription
117+
if: ${{ inputs.environment == 'dev' && inputs.create_mns_subscription }}
118+
working-directory: './lambdas/mns_subscription'
119+
run: |
120+
poetry install --no-root
121+
echo "Subscribing SQS to MNS for notifications..."
122+
make subscribe
97123
# TODO - replace with modular e2e test workflow
98124
# e2e-tests:
99125
# if: ${{ vars.RUN_E2E == 'true' && inputs.sub_environment == vars.ACTIVE_ENVIRONMENT }}

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,16 @@ build-proxy:
4141
scripts/build_proxy.sh
4242

4343
#Files to loop over in release
44-
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. specification sandbox terraform scripts $(PYTHON_PROJECT_DIRS) $(PYTHON_LAMBDA_DEPENDENCIES)"
44+
# VED-811: remove everything except for proxy related files as we move to Github Actions for backend deployment
45+
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. specification sandbox terraform scripts"
4546

4647

4748
#Create /dist/ sub-directory and copy files into directory
49+
#Ensure full dir structure is preserved for Lambdas
4850
release: clean publish build-proxy
4951
mkdir -p dist
5052
for f in $(_dist_include); do cp -r $$f dist; done
53+
for f in $(PYTHON_PROJECT_DIRS); do cp --parents -r $$f dist; done
5154
cp ecs-proxies-deploy.yml dist/ecs-deploy-sandbox.yml
5255
cp ecs-proxies-deploy.yml dist/ecs-deploy-internal-qa-sandbox.yml
5356
cp ecs-proxies-deploy.yml dist/ecs-deploy-internal-dev-sandbox.yml

azure/templates/post-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ steps:
9393
echo "Subscribing SQS to MNS for notifications..."
9494
make subscribe
9595
displayName: "Run MNS Subscription"
96-
workingDirectory: "$(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)/mns_subscription"
96+
workingDirectory: "$(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)/lambdas/mns_subscription"
9797
env:
9898
SQS_ARN: "$(ID_SYNC_QUEUE_ARN)"
9999

terraform/id_sync_lambda.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ module "id_sync_docker_image" {
4242

4343
platform = "linux/amd64"
4444
use_image_tag = false
45-
source_path = abspath("${path.root}/..")
45+
source_path = abspath("${path.root}/../lambdas")
4646
triggers = {
47-
dir_sha = local.id_sync_lambda_dir_sha
47+
dir_sha = local.id_sync_lambda_dir_sha
48+
shared_dir_sha = local.shared_dir_sha
4849
}
4950
}
5051

terraform/outputs.tf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,3 @@ output "id_sync_queue_arn" {
2222
description = "The ARN of the created SQS queue"
2323
value = aws_sqs_queue.id_sync_queue.arn
2424
}
25-
26-
output "lambdas_dir_abs_path" {
27-
value = local.id_sync_lambda_dir
28-
}
29-
30-
output "lambdas_dir_normal" {
31-
value = "${local.id_sync_lambda_dir}/id_sync"
32-
}

terraform/redis_sync_lambda.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Define the directory containing the Docker image and calculate its SHA-256 hash for triggering redeployments
22
locals {
3-
redis_sync_lambda_dir = abspath("${path.root}/../redis_sync")
3+
redis_sync_lambda_dir = abspath("${path.root}/../lambdas/redis_sync")
44

55
redis_sync_lambda_files = fileset(local.redis_sync_lambda_dir, "**")
66

@@ -42,9 +42,10 @@ module "redis_sync_docker_image" {
4242

4343
platform = "linux/amd64"
4444
use_image_tag = false
45-
source_path = abspath("${path.root}/..")
45+
source_path = abspath("${path.root}/../lambdas")
4646
triggers = {
47-
dir_sha = local.redis_sync_lambda_dir_sha
47+
dir_sha = local.redis_sync_lambda_dir_sha
48+
shared_dir_sha = local.shared_dir_sha
4849
}
4950
}
5051

0 commit comments

Comments
 (0)