-
Notifications
You must be signed in to change notification settings - Fork 34
/
Makefile
61 lines (51 loc) · 1.68 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
ifndef VERBOSE
MAKEFLAGS += --no-print-directory
endif
default: install
.PHONY: install lint unit
OS_ARCH=linux_amd64
#
# Set correct OS_ARCH on Mac
UNAME := $(shell uname -s)
ifeq ($(UNAME),Darwin)
HW := $(shell uname -m)
ifeq ($(HW),arm64)
ARCH=$(HW)
else
ARCH=amd64
endif
OS_ARCH=darwin_$(ARCH)
endif
HOSTNAME=registry.terraform.io
NAMESPACE=Kaginari
NAME=mongodb
VERSION=9.9.9
## on linux base os
TERRAFORM_PLUGINS_DIRECTORY=~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
install:
mkdir -p ${TERRAFORM_PLUGINS_DIRECTORY}
go build -o ${TERRAFORM_PLUGINS_DIRECTORY}/terraform-provider-${NAME}
cd examples && rm -rf .terraform
cd examples && make init
re-install:
rm -f ${TERRAFORM_PLUGINS_DIRECTORY}/terraform-provider-${NAME}
go build -o ${TERRAFORM_PLUGINS_DIRECTORY}/terraform-provider-${NAME}
cd examples && rm -rf .terraform
cd examples && make init
lint:
golangci-lint run
documentdb-test:
rm -f ${TERRAFORM_PLUGINS_DIRECTORY}/terraform-provider-${NAME}
go build -o ${TERRAFORM_PLUGINS_DIRECTORY}/terraform-provider-${NAME}
cd examples && rm -rf .terraform
cd examples/documentDB && rm -rf .terraform && make init
documentdb-test-apply:
rm -f ${TERRAFORM_PLUGINS_DIRECTORY}/terraform-provider-${NAME}
go build -o ${TERRAFORM_PLUGINS_DIRECTORY}/terraform-provider-${NAME}
cd examples && rm -rf .terraform
cd examples/documentDB && rm -rf .terraform && make init && make apply
documentdb-test-apply:
rm -f ${TERRAFORM_PLUGINS_DIRECTORY}/terraform-provider-${NAME}
go build -o ${TERRAFORM_PLUGINS_DIRECTORY}/terraform-provider-${NAME}
cd examples && rm -rf .terraform
cd examples/documentDB && rm -rf .terraform && make init && make destroy