forked from fluxcd/terraform-provider-flux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (39 loc) · 1.11 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
.ONESHELL:
SHELL := /bin/bash
TEST_COUNT?=1
ACCTEST_PARALLELISM?=4
ACCTEST_TIMEOUT?=10m
all: test testacc build
tidy:
go mod tidy
fmt:
go fmt ./...
vet:
go vet ./...
test: tidy fmt vet
go test ./... -coverprofile cover.out
testacc: tidy fmt vet
TF_ACC=1 go test ./pkg/provider -v -count $(TEST_COUNT) -parallel $(ACCTEST_PARALLELISM) -timeout $(ACCTEST_TIMEOUT)
build:
CGO_ENABLED=0 go build -o ./bin/flux main.go
install: build
mkdir -p ~/.terraform.d/plugins/registry.terraform.io/fluxcd/flux/0.0.0-dev/$${GOOS}_$${GOARCH}
cp ./bin/flux ~/.terraform.d/plugins/registry.terraform.io/fluxcd/flux/0.0.0-dev/$${GOOS}_$${GOARCH}/terraform-provider-flux
.PHONY: docs
docs: tools
tfplugindocs generate
tools:
GO111MODULE=on go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
.SILENT:
lint:
set -e
echo lint: Start
EXAMPLES=$$(find examples -mindepth 1 -maxdepth 1 -type d)
DELETE=examples/data-sources
echo $${array[@]/$$DELETE}
EXAMPLES=( "$${EXAMPLES[@]/$$DELETE}" )
for EXAMPLE in $${EXAMPLES}; do
echo $$EXAMPLE
tflint -c examples/.tflint.hcl $${EXAMPLE}
done
echo lint: Success