-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (49 loc) · 1.51 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
BIN_DIR = bin
export GOPATH ?= $(shell go env GOPATH)
export GO111MODULE ?= on
LINUX=LINUX
OSX=OSX
WINDOWS=WIN32
OSFLAG :=
ifeq ($(OS),Windows_NT)
OSFLAG = $(WINDOWS)
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
OSFLAG = $(LINUX)
endif
ifeq ($(UNAME_S),Darwin)
OSFLAG = $(OSX)
endif
endif
.PHONY: lint
lint: ## run linter
golangci-lint --color=always run ./... -v
lint_helm_templates:
./scripts/debug_helm.sh
.PHONY: test
test: # run all programmatic interaction tests
go test -v -p 5 ./...
.PHONY: install_cli
install_cli: # installs CLI
go install cmd/cli/envcli.go
install_tools:
ifeq ($(OSFLAG),$(WINDOWS))
echo "If you are running windows and know how to install what is needed, please contribute by adding it here!"
exit 1
endif
ifeq ($(OSFLAG),$(LINUX))
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${BIN_DIR} v$(shell cat ./.tool-versions | grep golangci-lint | sed -En "s/golangci-lint.(.*)/\1/p")
# TODO: golang, k3d, act
endif
ifeq ($(OSFLAG),$(OSX))
brew install asdf
asdf plugin-add golang https://github.com/kennyp/asdf-golang.git || true
asdf plugin add k3d https://github.com/spencergilbert/asdf-k3d.git || true
asdf plugin add act https://github.com/grimoh/asdf-act.git || true
asdf plugin add golangci-lint https://github.com/hypnoglow/asdf-golangci-lint.git || true
asdf plugin-add helm https://github.com/Antiarchitect/asdf-helm.git || true
asdf plugin add actionlint || true
asdf plugin add shellcheck || true
asdf install
endif