-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
37 lines (29 loc) · 908 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
default: testacc
# temporary, for convenience
ORG := registry.terraform.io/ciscodevnet
NAME := cml2
ARCH := linux_amd64
VERSION := $(shell git describe --long | sed -re 's/^v(.*)$$/\1/')
DEST := ~/.terraform.d/plugins/$(ORG)/$(NAME)/$(VERSION)/$(ARCH)
MIRROR := /tmp/terraform/$(ORG)/$(NAME)
TESTARGS := -cover -v
# Run tests
.PHONY: tests
tests:
go test ./... -v $(TESTARGS) -timeout 120m
# Run acceptance tests
.PHONY: testacc
testacc:
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m
build: main.go
go build -o terraform-provider-$(NAME) -ldflags "-X main.version=$(VERSION)" .
devinstall: build
test -d $(DEST) || mkdir -p $(DEST)
mv terraform-provider-$(NAME) $(DEST)
# this needs goreleaser installed and the following env vars defined
# GITHUB_TOKEN
# GPG_FINGERPRINT
mirror:
goreleaser release --skip-publish --rm-dist
test -d $(DEST) || mkdir -p $(MIRROR)
cp dist/*.zip $(MIRROR)