forked from goharbor/acceleration-service
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
29 lines (23 loc) · 986 Bytes
/
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
GIT_COMMIT := $(shell git rev-list -1 HEAD)
BUILD_TIME := $(shell date -u +%Y%m%d.%H%M)
CWD := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
# Build binary to ./
default: check
go build -ldflags '-X main.versionGitCommit=${GIT_COMMIT} -X main.versionBuildTime=${BUILD_TIME}' -gcflags=all="-N -l" ./cmd/acceld
go build -ldflags '-X main.versionGitCommit=${GIT_COMMIT} -X main.versionBuildTime=${BUILD_TIME}' -gcflags=all="-N -l" ./cmd/accelctl
install-check-tools:
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.42.1
check:
@echo "$@"
@$(shell go env GOPATH)/bin/golangci-lint run
@$(shell go env GOPATH)/bin/golangci-lint run
# Run unit testing
# Run a particular test in this way:
# go test -v -count=1 -run TestFoo ./pkg/...
ut: default
go test -count=1 -v ./pkg/...
# Run integration testing
smoke: default
go test -count=1 -v ./test
# Run testing
test: default ut smoke