forked from cloudposse/terraform-provider-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (33 loc) · 1.1 KB
/
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
35
36
37
38
39
40
41
42
43
TEST?=$$(go list ./... | grep -v 'vendor')
HOSTNAME=registry.terraform.io
NAMESPACE=cloudposse
NAME=utils
BINARY=terraform-provider-${NAME}
VERSION=9999.99.99
#GOOS=darwin
GOOS=linux
GOARCH=amd64
SHELL := /bin/bash
# List of targets the `readme` target should call before generating the readme
export README_DEPS ?= docs/targets.md docs/terraform.md
-include $(shell curl -sSL -o .build-harness "https://cloudposse.tools/build-harness"; echo .build-harness)
get:
go get
build: get
env GOOS=${GOOS} GOARCH=${GOARCH} go build
deps:
go mod download
docs:
go generate
install: build
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${GOOS}_${GOARCH}
mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${GOOS}_${GOARCH}
# Lint terraform code
lint:
$(SELF) terraform/install terraform/get-modules terraform/get-plugins terraform/lint terraform/validate
# Run acceptance tests
testacc: install
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 3m
tfplugindocs:
go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
tfplugindocs generate