-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
62 lines (47 loc) · 1.16 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
# kernel-style V=1 build verbosity
ifeq ("$(origin V)", "command line")
BUILD_VERBOSE = $(V)
endif
ifeq ($(BUILD_VERBOSE),1)
Q =
else
Q = @
endif
SHELL := /bin/bash
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=helmExport
BINARY_UNIX=$(BINARY_NAME)_unix
export GO111MODULE=on
validate:
@if [[ -z "${role}" && -z "${workspace}" && -z "${helm_chart}" ]]; then \
echo "Please set env variables, (source env.sh)"; \
exit 1; \
fi
dependency:
$(Q) curl-sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.23.1
tidy:
$(Q)go mod tidy -v
lint:
$(Q)golangci-lint run --verbose
test:
$(Q)go test -v -race ./...
all: build
build:
$(GOBUILD) -o $(BINARY_NAME) -v ./*.go
.PHONY: clean
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
rm -f $(BINARY_UNIX)
rm -rf workspace
run:
$(GOBUILD) -o $(BINARY_NAME) -v ./*.go
./$(BINARY_NAME)
.PHONY: example
example: validate
$(GOBUILD) -o $(BINARY_NAME) -v ./*.go
./$(BINARY_NAME) export ${role} --helm-chart=${helm_chart} --workspace=${workspace} --generateFilters=true