Skip to content

Commit 7244ebc

Browse files
committed
NRL-1595 check deployed version written to state correctly
1 parent 13318c3 commit 7244ebc

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

.github/workflows/deploy-account-wide-infra.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,14 @@ jobs:
158158
# -var 'assume_role=terraform'
159159

160160
# TODO: fix this
161-
# # Is this where we'd burn commit & datetime into state?
162-
# - name: Update environment config version
163-
# env:
164-
# ENVIRONMENT: ${{ 'account-dev' }}
165-
# run: |
166-
# deployed_version=$(terraform -chdir=terraform/account-wide-infrastructure/${ACCOUNT_NAME} output --raw version)
167-
# poetry run python ./scripts/set_env_config.py inactive-version ${deployed_version} $ENVIRONMENT
161+
# Is this where we'd burn commit & datetime into state?
162+
- name: Update environment config version
163+
env:
164+
ACCOUNT_NAME: ${{ vars.ACCOUNT_NAME }}
165+
run: |
166+
deployed_version=$(terraform -chdir=terraform/account-wide-infrastructure/${ACCOUNT_NAME} output --raw version)
167+
echo $deployed_version
168+
poetry run python ./scripts/set_env_config.py inactive-version ${deployed_version} $ACCOUNT_NAME
168169
169170
# Slack notif: starting deploy of account-wide infra <branch deets>
170171
# tf-plan: ensure output is visible in job output

terraform/account-wide-infrastructure/dev/data.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@ data "aws_secretsmanager_secret" "emails" {
1717
data "aws_secretsmanager_secret_version" "emails" {
1818
secret_id = data.aws_secretsmanager_secret.emails.id
1919
}
20+
21+
data "external" "current-info" {
22+
program = [
23+
"bash",
24+
"../../../scripts/get-current-info.sh",
25+
]
26+
}

terraform/account-wide-infrastructure/dev/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ output "athena_kms_key_arn" {
2222
description = "KMS key ARN for Athena encryption"
2323
value = var.enable_reporting ? module.dev-athena[0].kms_key_arn : null
2424
}
25+
26+
output "version" {
27+
value = data.external.current-info.result.version
28+
}

0 commit comments

Comments
 (0)