Skip to content

Commit

Permalink
refactor: use -chdir in terraform_validate wrapper (#2617)
Browse files Browse the repository at this point in the history
  • Loading branch information
wyardley authored Sep 25, 2024
1 parent 24d30aa commit 9907e7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion infra/build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ OPA_VERSION := 0.52.0
# Updated by Update Tooling Workflow
GCRANE_VERSION := 0.20.2

DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.22.12
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.22.13
DOCKER_TAG_MAJOR_VERSION_DEVELOPER_TOOLS := $(firstword $(subst ., , $(DOCKER_TAG_VERSION_DEVELOPER_TOOLS)))
DOCKER_TAG_MINOR_VERSION_DEVELOPER_TOOLS := $(shell echo "${DOCKER_TAG_VERSION_DEVELOPER_TOOLS}" | awk -F. '{print $$1"."$$2}')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,5 @@
# files to validate. This directory is assumed to be a root module.

set -eu
curdir=$(pwd)
cd "${1}"
flock -x /workspace/.terraform.lock -c "terraform init -backend=false >/dev/null"
flock -s /workspace/.terraform.lock -c "terraform validate"
cd "$curdir"
flock -x /workspace/.terraform.lock -c "terraform init -compact-warnings -chdir=$1 -backend=false >/dev/null"
flock -s /workspace/.terraform.lock -c "terraform -chdir=$1 validate"

0 comments on commit 9907e7f

Please sign in to comment.