-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGNUmakefile
47 lines (37 loc) · 1.42 KB
/
GNUmakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
default: testacc
# Run acceptance tests
.PHONY: testacc
testacc:
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m
# Change these variables as necessary.
MAIN_PACKAGE_PATH := ./
BINARY_NAME := terraform-provider-tfmigrate
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## tidy: format code and tidy modfile
.PHONY: tidy
tidy:
go fmt ./...
go mod tidy -v
# ==================================================================================== #
# DEVELOPMENT
# ==================================================================================== #
## Add this to your ~/.zshrc or ~/.bashrc
## export PATH=$PATH:$GOPATH/bin
.PHONY: build
build:
go build -o ${GOPATH}/bin/${BINARY_NAME} ${MAIN_PACKAGE_PATH}
rm -f ./${BINARY_NAME}
cp ${GOPATH}/bin/${BINARY_NAME} ${MAIN_PACKAGE_PATH}${BINARY_NAME}
mkdir -p ${HOME}/.terraform.d/plugins/registry.terraform.io/hashicorp/tfmigrate/0.1.0/darwin_arm64
cp ${GOPATH}/bin/${BINARY_NAME} ${HOME}/.terraform.d/plugins/registry.terraform.io/hashicorp/tfmigrate/0.1.0/darwin_arm64/${BINARY_NAME}
.PHONY: run
run:
rm -rf .terraform .terraform.lock.hcl terraform.tfstate terraform.tfstate.backup
terraform init
TF_LOG=TRACE terraform apply -auto-approve
.PHONY: runverb
runverb:
rm -rf .terraform .terraform.lock.hcl
TF_LOG=INFO terraform apply -auto-approve