forked from cello-proj/cello
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (28 loc) · 1.07 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
# RFC3339 (to match GoReleaser)
DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
GIT_COMMIT := $(shell git rev-parse HEAD)
GO_LDFLAGS := -ldflags="-s -w -X 'main.version=$(GIT_COMMIT)' -X 'main.commit=$(GIT_COMMIT)' -X 'main.date=$(DATE)'"
all: test build_service build_cli
build_service: clean_service
CGO_ENABLED=0 GOARCH=amd64 go build -trimpath $(GO_LDFLAGS) -o build/service ./service/
build_cli: clean_cli
CGO_ENABLED=0 GOARCH=amd64 go build -trimpath $(GO_LDFLAGS) -o build/argo-cloudops ./cli/
lint:
@#Install the linter from here:
@#https://github.com/golangci/golangci-lint#install
golangci-lint run
test:
go test -race -timeout=180s -coverprofile=coverage.out ./...
tidy:
go mod tidy
cover: ## Generates coverage report
@$(MAKE) test TESTARGS="-tags test -coverprofile=coverage.out"
@go tool cover -html=coverage.out
@rm -f coverage.out
clean_service:
@rm -f ./build/service
clean_cli:
@rm -f ./build/argo-cloudops
up: ## Starts a local vault and api locally
bash scripts/start_local.sh
.PHONY: build_service build_cli lint test tidy cover clean_cli clean_service up