-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
34 lines (26 loc) · 865 Bytes
/
Makefile
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
HOSTNAME=aws.amazon.com
NAMESPACE=terraform
NAME=buildonaws
VERSION=1.0
OS_NAME:=$(shell uname -s | tr ‘[:upper:]’ ‘[:lower:]’)
HW_CLASS:=$(shell uname -m)
OS_ARCH=${OS_NAME}_${HW_CLASS}
BINARY=terraform-provider-${NAME}
PLUGIN_DIR=${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
default: install
clean:
@echo "▶️ Removing the Terraform plugin"
rm -rf ~/.terraform.d/plugins/${PLUGIN_DIR}
rm -rf examples/.terraform* || true
build: clean
@echo "▶️ Building the Terraform binary file"
go build -gcflags="all=-N -l" -o ${BINARY}
install: build
@echo "▶️ Adding the binary to the plugin directory"
mkdir -p ~/.terraform.d/plugins/${PLUGIN_DIR}
mv ${BINARY} ~/.terraform.d/plugins/${PLUGIN_DIR}
@echo "▶️ Build executed successfully"
test:
TF_ACC=1 go test -count=1 -timeout 5m -v ./${NAME}
generate:
go generate ./...