Skip to content

Commit 53647c5

Browse files
authored
Use BUILD_TAG to tag cloud resources (#755)
* Use REPO_BUILD_TAG to tag cloud resources * Fix * Fix * Fix * Fix * Fix * Use exec to call script * Address PR comments
1 parent 87d3cdd commit 53647c5

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

internal/install/_static/Dockerfile.terraform_deployer

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ HEALTHCHECK --timeout=3s CMD sh -c "[ -f /tmp/tf-applied ]"
2020
ENV TF_IN_AUTOMATION=true
2121
ENV TF_CLI_ARGS="-no-color"
2222
ADD run.sh /
23+
RUN chmod +x /run.sh
2324
WORKDIR /workspace
2425

25-
ENTRYPOINT bash /run.sh
26+
ENTRYPOINT exec /run.sh

internal/install/_static/terraform_deployer.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ services:
33
terraform:
44
build: .
55
tty: true
6+
stop_grace_period: 5m
67
environment:
78
- TF_VAR_TEST_RUN_ID=${TF_VAR_TEST_RUN_ID:-detached}
9+
- TF_VAR_REPO_NAME=${REPO_NAME:-unknown}
10+
- TF_VAR_PULL_REQUEST=pr-${CHANGE_ID:-unknown}
11+
- TF_VAR_CI_BUILD_NUMBER=${BUILD_NUMBER:-unknown}
812
volumes:
913
- ${TF_DIR}:/stage

test/packages/parallel/gcp/data_stream/compute/_dev/deploy/tf/compute.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ resource "google_compute_instance" "default" {
1313
zone = var.zone
1414

1515
labels = {
16-
team = "integrations"
1716
run_id = var.TEST_RUN_ID
17+
repo_name = var.REPO_NAME
18+
pull_request = var.PULL_REQUEST
19+
ci_build_number = var.CI_BUILD_NUMBER
1820
}
1921

2022
boot_disk {

test/packages/parallel/gcp/data_stream/compute/_dev/deploy/tf/vars.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ variable "TEST_RUN_ID" {
22
default = "detached"
33
}
44

5+
variable "REPO_NAME" {
6+
default = "unknown-repo"
7+
}
8+
9+
variable "PULL_REQUEST" {
10+
default = "unknown-pr"
11+
}
12+
13+
variable "CI_BUILD_NUMBER" {
14+
default = "unknown-build"
15+
}
16+
517
variable "gcp_project_id" {
618
type = string
719
}

0 commit comments

Comments
 (0)