This repository was archived by the owner on Jun 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (57 loc) · 1.62 KB
/
Makefile
File metadata and controls
70 lines (57 loc) · 1.62 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
default: build
NAME:=github-app
ifeq ($(GITHUB_REF),)
GITHUB_REF := dev
endif
ifeq ($(VERSION),)
VERSION := $(shell echo $(GITHUB_REF) | sed 's|refs/tags/||') built $(shell date)
endif
.PHONY: help
help:
@cat docs/make-targets.md
.PHONY: release
release: setup linux darwin compress
.PHONY: setup
setup:
which esc 2>&1 > /dev/null || go get -u github.com/mjibson/esc
which github-release 2>&1 > /dev/null || go get github.com/aktau/github-release
.PHONY: build
build:
go build -o ./.bin/$(NAME) -ldflags "-X \"main.version=$(VERSION)\"" main.go
.PHONY: linux
linux:
GOOS=linux go build -o ./.bin/$(NAME) -ldflags "-X \"main.version=$(VERSION)\"" main.go
.PHONY: darwin
darwin:
GOOS=darwin go build -o ./.bin/$(NAME)_osx -ldflags "-X \"main.version=$(VERSION)\"" main.go
.PHONY: compress
compress:
upx -5 ./.bin/*
.PHONY: install
install:
cp ./.bin/$(NAME) /usr/local/bin/
.PHONY: docker
docker:
docker build ./ -t $(NAME)
#TODO: docs
#.PHONY: serve-docs
#serve-docs:
# docker run --rm -it -p 8000:8000 -v $(PWD):/docs -w /docs squidfunk/mkdocs-material:5.1.5
#
#.PHONY: build-api-docs
#build-api-docs:
# go run main.go docs api pkg/types/config.go pkg/types/types.go pkg/types/nsx.go > docs/reference/config.md
# go run main.go docs cli "docs/cli"
#
#.PHONY: build-docs
#build-docs:
# which mkdocs || pip install mkdocs mkdocs-material
# mkdocs build -d build/docs
#
#.PHONY: deploy-docs
#deploy-docs:
# which netlify 2>&1 > /dev/null || sudo npm install -g netlify-cli
# netlify deploy --site b7d97db0-1bc2-4e8c-903d-6ebf3da18358 --prod --dir build/docs
.PHONY: lint
lint: build
golangci-lint run --verbose --print-resources-usage