forked from tsuru/tsuru-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (53 loc) · 1.68 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
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
71
72
73
74
75
76
# Copyright 2017 tsuru-client authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Python interpreter path
PYTHON := $(shell which python)
GHR := $(shell which ghr)
GITHUB_TOKEN := $(shell git config --global --get github.token || echo $$GITHUB_TOKEN)
release:
@if [ ! $(version) ]; then \
echo "version parameter is required... use: make release version=<value>"; \
exit 1; \
fi
@if [ "$(GHR)" == "" ]; then \
echo "ghr is required. Instructions: github.com/tcnksm/ghr"; \
exit 1; \
fi
@if [ ! "$(GITHUB_TOKEN)" ]; then \
echo "github token should be configurated. Instructions: github.com/tcnksm/ghr"; \
exit 1; \
fi
@echo " ==> Releasing tsuru $(version) version."
@echo " ==> Replacing version string."
@sed -i "" "s/version = \".*\"/version = \"$(version)\"/g" tsuru/main.go
@echo " ==> Building binaries."
@./misc/build-all.sh
@echo " ==> Bumping version."
@git add tsuru/main.go
@git commit -m "bump to $(version)"
@echo " ==> Creating tag."
@git tag $(version)
@echo " ==> Uploading binaries to github."
ghr --repository tsuru-client --username tsuru --draft --recreate $(version) dist/
@echo " ==> Pushing changes to github."
@git push --tags
@git push origin master
doc-requirements:
@pip install -r requirements.txt
docs-clean:
@rm -rf ./docs/build
doc: docs-clean doc-requirements
@tsuru_sphinx tsuru docs/ && cd docs && make html SPHINXOPTS="-N -W"
docs: doc
test:
go test ./... -check.vv
install:
go install ./...
build-all:
./misc/build-all.sh
build:
go build -o ./bin/tsuru ./tsuru
check-docs: build
./misc/check-all-cmds-docs.sh
.PHONY: doc docs release manpage