forked from flyteorg/flytectl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (33 loc) · 1.36 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
export REPOSITORY=flytectl
include boilerplate/flyte/golang_test_targets/Makefile
include boilerplate/flyte/precommit/Makefile
GIT_VERSION := $(shell git describe --always --tags)
GIT_HASH := $(shell git rev-parse --short HEAD)
TIMESTAMP := $(shell date '+%Y-%m-%d')
PACKAGE ?=github.com/flyteorg/flytestdlib
LD_FLAGS="-s -w -X $(PACKAGE)/version.Version=$(GIT_VERSION) -X $(PACKAGE)/version.Build=$(GIT_HASH) -X $(PACKAGE)/version.BuildTime=$(TIMESTAMP)"
define PIP_COMPILE
pip-compile $(1) --upgrade --verbose
endef
generate:
go test github.com/flyteorg/flytectl/cmd --update
compile:
go build -o bin/flytectl -ldflags=$(LD_FLAGS) main.go
compile_debug:
go build -gcflags='all=-N -l' -o bin/flytectl main.go
.PHONY: update_boilerplate
update_boilerplate:
@curl https://raw.githubusercontent.com/flyteorg/boilerplate/master/boilerplate/update.sh -o boilerplate/update.sh
@boilerplate/update.sh
.PHONY: install-piptools
install-piptools:
pip install -U pip-tools
.PHONY: doc-requirements.txt
doc-requirements.txt: doc-requirements.in install-piptools
$(call PIP_COMPILE,doc-requirements.in)
.PHONY: test_unit_without_flag
test_unit_without_flag:
go test ./... -race -coverprofile=coverage.temp.txt -covermode=atomic
cat coverage.temp.txt | grep -v "_flags.go" > coverage.txt
rm coverage.temp.txt
curl -s https://codecov.io/bash > codecov_bash.sh && bash codecov_bash.sh