-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (38 loc) · 1.2 KB
/
Makefile
File metadata and controls
51 lines (38 loc) · 1.2 KB
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
export GO111MODULE=on
export PATH:=/usr/local/go/bin:$(PATH)
exec_path := /usr/local/bin/
exec_name := kontainer-engine-driver-otc
VERSION := 1.1.1
default: test build
test: vet acceptance
fmt:
@echo Running go fmt
@go fmt
lint:
@echo Running go lint
@golangci-lint run
vet:
@echo "go vet ."
@go vet $$(go list ./... | grep -v vendor/) ; if [ $$? -eq 1 ]; then \
echo ""; \
echo "Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for review."; \
exit 1; \
fi
acceptance:
@echo "Starting acceptance tests..."
@go test -race -timeout 40m -v github.com/opentelekomcloud/kontainer-engine-driver-otc/opentelekomcloud
build: build-linux
build-linux:
@echo "Build driver for Linux"
@go build --trimpath -o bin/$(exec_name)
build-windows:
@echo "Build driver for Windows"
@GOOS=windows go build --trimpath -o bin/$(exec_name).exe
build-all: build-linux
install:
@cp ./bin/$(exec_name) $(exec_path)
@echo "Driver installed to $(exec_path)$(exec_name)"
release: build-all
@tar -czf "./bin/$(exec_name)-$(VERSION)-linux-amd64.tgz" "./bin/$(exec_name)" && rm "./bin/$(exec_name)"
@echo "Release versions are built"