Skip to content

Commit

Permalink
chore: reuse existing terraform from path
Browse files Browse the repository at this point in the history
  • Loading branch information
bahkauv70 committed Dec 18, 2024
1 parent f16e0b4 commit 40b604b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ROOT_DIR ?= $(shell git rev-parse --show-toplevel)
SCRIPTS_BASE ?= $(ROOT_DIR)/scripts
BIN_DIR ?= $(ROOT_DIR)/bin

# SETUP AND TOOL INITIALIZATION TASKS
project-help:
Expand All @@ -15,7 +16,7 @@ lint-golangci-lint:

lint-tf:
@echo "Linting examples"
@./bin/terraform fmt -check -diff -recursive examples
PATH=$(PATH):$(BIN_DIR) terraform fmt -check -diff -recursive examples

lint: lint-golangci-lint lint-tf

Expand Down
12 changes: 8 additions & 4 deletions scripts/project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ elif [ "$action" = "tools" ]; then

go install github.com/golangci/golangci-lint/cmd/[email protected]
go install github.com/hashicorp/terraform-plugin-docs/cmd/[email protected]
# terraform binary is only available as zip, not .tgz
mkdir -p bin
curl -o bin/terraform.zip -J https://releases.hashicorp.com/terraform/1.10.2/terraform_1.10.2_linux_amd64.zip
unzip -d bin bin/terraform.zip

# if terraform binary not available then download it
if ! which terraform; then
# terraform binary is only available as zip, not .tgz
mkdir -p bin
curl -o bin/terraform.zip -J https://releases.hashicorp.com/terraform/1.10.2/terraform_1.10.2_linux_amd64.zip
unzip -d bin bin/terraform.zip
fi
else
echo "Invalid action: '$action', please use $0 help for help"
fi

0 comments on commit 40b604b

Please sign in to comment.