forked from scottwinkler/terraform-provider-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (31 loc) · 909 Bytes
/
Makefile
File metadata and controls
40 lines (31 loc) · 909 Bytes
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
.DEFAULT_GOAL := build
OS := $(shell go env GOOS)
ARCH := $(shell go env GOARCH)
PLUGIN_PATH := ${HOME}/.terraform.d/plugins/${OS}_${ARCH}
PLUGIN_NAME := terraform-provider-shell
DIST_PATH := dist/${OS}_${ARCH}
GO_PACKAGES := $(shell go list ./... | grep -v /vendor/)
GO_FILES := $(shell find . -type f -name '*.go')
.PHONY: all
all: test build
.PHONY: test
test: test-all
.PHONY: test-all
test-all:
@TF_ACC=1 go test -v -race $(GO_PACKAGES)
${DIST_PATH}/${PLUGIN_NAME}: ${GO_FILES}
mkdir -p $(DIST_PATH); \
go build -o $(DIST_PATH)/${PLUGIN_NAME}
.PHONY: build
build: ${DIST_PATH}/${PLUGIN_NAME}
.PHONY: install
install: build
mkdir -p $(PLUGIN_PATH); \
rm -rf $(PLUGIN_PATH)/${PLUGIN_NAME}; \
install -m 0755 $(DIST_PATH)/${PLUGIN_NAME} $(PLUGIN_PATH)/${PLUGIN_NAME}
.PHONY: clean
clean:
rm -rf ${DIST_PATH}/*
.PHONY: update
update:
dep ensure -update -v