-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathGNUmakefile
41 lines (34 loc) · 938 Bytes
/
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
DEV := deploymenttheory
PROVIDER := jamfpro
VERSION := $(shell git describe --abbrev=0 --tags --match "v*")
PLUGINS := ${HOME}/bin/plugins/registry.terraform.io/${DEV}/${PROVIDER}
BIN := terraform-provider-jamfpro_${VERSION}
define TERRAFORMRC
add the following config to ~/.terraformrc to enable override:
```
provider_installation {
dev_overrides {
"${DEV}/${PROVIDER}" = "${PLUGINS}"
}
}
```
endef
default: testacc
# Run acceptance tests
.PHONY: testacc
testacc:
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m
# Run go build. Output to dist/.
.PHONY: build
build:
@mkdir -p dist
go build -o dist/${BIN} .
# Run go build. Output to dist/.
.PHONY: build_override
build_override: build
mkdir -p ${PLUGINS}
mv dist/${BIN} ${PLUGINS}/${BIN}
# Run go build. Move artifact to terraform plugins dir. Output override config for ~/.terraformrc
.PHONY: install
install: build_override
$(info ${TERRAFORMRC})