Skip to content

Commit

Permalink
Use BUILD_TAG to tag cloud resources (#755)
Browse files Browse the repository at this point in the history
* Use REPO_BUILD_TAG to tag cloud resources

* Fix

* Fix

* Fix

* Fix

* Fix

* Use exec to call script

* Address PR comments
  • Loading branch information
mtojek authored Mar 28, 2022
1 parent 87d3cdd commit 53647c5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion internal/install/_static/Dockerfile.terraform_deployer
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ HEALTHCHECK --timeout=3s CMD sh -c "[ -f /tmp/tf-applied ]"
ENV TF_IN_AUTOMATION=true
ENV TF_CLI_ARGS="-no-color"
ADD run.sh /
RUN chmod +x /run.sh
WORKDIR /workspace

ENTRYPOINT bash /run.sh
ENTRYPOINT exec /run.sh
4 changes: 4 additions & 0 deletions internal/install/_static/terraform_deployer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ services:
terraform:
build: .
tty: true
stop_grace_period: 5m
environment:
- TF_VAR_TEST_RUN_ID=${TF_VAR_TEST_RUN_ID:-detached}
- TF_VAR_REPO_NAME=${REPO_NAME:-unknown}
- TF_VAR_PULL_REQUEST=pr-${CHANGE_ID:-unknown}
- TF_VAR_CI_BUILD_NUMBER=${BUILD_NUMBER:-unknown}
volumes:
- ${TF_DIR}:/stage
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ resource "google_compute_instance" "default" {
zone = var.zone

labels = {
team = "integrations"
run_id = var.TEST_RUN_ID
repo_name = var.REPO_NAME
pull_request = var.PULL_REQUEST
ci_build_number = var.CI_BUILD_NUMBER
}

boot_disk {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ variable "TEST_RUN_ID" {
default = "detached"
}

variable "REPO_NAME" {
default = "unknown-repo"
}

variable "PULL_REQUEST" {
default = "unknown-pr"
}

variable "CI_BUILD_NUMBER" {
default = "unknown-build"
}

variable "gcp_project_id" {
type = string
}
Expand Down

0 comments on commit 53647c5

Please sign in to comment.