forked from superfly/flyctl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (27 loc) · 1.04 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
NOW_RFC3339 = $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
GIT_SHA = $(shell git rev-parse HEAD 2>/dev/null || no_git)
GIT_BRANCH = $(shell git symbolic-ref --short HEAD 2>/dev/null ||:)
ifneq ($(GIT_BRANCH),)
GIT_COMMIT = $(GIT_SHA) ($(GIT_BRANCH))
else
GIT_COMMIT = $(GIT_SHA)
endif
all: build cmddocs
generate:
@echo Running Generate for Help and GraphQL client
go generate ./...
build: generate
@echo Running Build
go build -o bin/flyctl -ldflags="-X 'github.com/superfly/flyctl/internal/buildinfo.buildDate=$(NOW_RFC3339)' -X 'github.com/superfly/flyctl/internal/buildinfo.commit=$(GIT_COMMIT)'" .
test: FORCE
go test ./... -ldflags="-X 'github.com/superfly/flyctl/internal/buildinfo.buildDate=$(NOW_RFC3339)'" --run=$(T)
# to run one test, use: make preflight-test T=TestAppsV2ConfigSave
preflight-test: build
if [ -r .direnv/preflight ]; then . .direnv/preflight; fi; \
go test ./test/preflight --tags=integration -v --run=$(T)
cmddocs: generate
@echo Running Docs Generation
bash scripts/generate_docs.sh
pre:
pre-commit run --all-files
FORCE: