forked from nolte/terraform-provider-harbor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
93 lines (64 loc) · 2.02 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
VERSION=1.0
# helper to run go from project root
GO := go
# generate harbor cient files from swagger config
define install_provider
tar -zxf bin/terraform-provider-harbor_*_linux_amd64.tar.gz -C ~/.terraform.d/plugins/linux_amd64/
chmod +x ~/.terraform.d/plugins/linux_amd64/terraform-provider-harbor
endef
TEST?=$$(go list ./... |grep -v 'vendor')
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
MAKEFLAGS += --silent
default: build
generate:
scripts/build-00-generate-client.sh
compile:
scripts/build-10-compile.sh
install:
$(call install_provider)
build: generate test compile
fmt:
echo "==> Formatting files with fmt..."
gofmt -w -s $(GOFMT_FILES)
test: goLint scriptsLint vet
go test $(TEST)
fmtcheck:
scripts/build-03-go-gofmtcheck.sh
vet:
echo "==> Checking code with vet..."
go vet ./...
goLint:
scripts/build-03-go-gofmtcheck.sh
scripts/build-04-go-errorchecks.sh
scripts/build-05-go-golint.sh
gosec:
echo "==> Checking code with gosec..."
# TODO Remove unused files from generated sources !!!
gosec -exclude-dir=gen/harborctl/client/scanners ./...
scriptsLint:
echo "==> Checking scripts with shellcheck..."
shellcheck scripts/*.sh
e2e_prepare:
scripts/tst-00-prepare-kind.sh
e2e_prepare_harbor_v1:
scripts/tst-01-prepare-harbor.sh "172-17-0-1.sslip.io" "1.3.4"
e2e_prepare_harbor_v2:
scripts/tst-01-prepare-harbor.sh "172-17-0-1.sslip.io" "1.4.0"
e2e_prepare_harbor_v2_1:
scripts/tst-01-prepare-harbor.sh "172-17-0-1.sslip.io" "1.4.1"
e2e_clean_cluster:
kind delete cluster || true
e2e_clean_harbor:
helm delete tf-harbor-test -n harbor
sleep 10
e2e_test_v2:
scripts/tst-15-execute-go-acc.sh "/api/v2.0"
e2e_test_v1:
scripts/tst-15-execute-go-acc.sh "/api"
e2e_test_classic:
bats scripts/test/bats
e2e_full_run: e2e_clean_cluster e2e_prepare e2e_prepare_harbor_v2 e2e_test_v2 e2e_clean_harbor e2e_prepare_harbor_v1 e2e_test_v1 e2e_clean_cluster
# e2e_prepare e2e_prepare_harbor_v1 e2e_test e2e_cleanup
spellingCheck:
mdspell '**/*.md' '!**/node_modules/**/*.md'
.PHONY: default install