forked from wamdam/backy2
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
75 lines (61 loc) · 2.65 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
PYTHON=env/bin/python3
SPHINX_MULTIVERSION=env/bin/sphinx-multiversion
PIP=env/bin/pip
PYTEST=env/bin/py.test
CURRENT_VERSION := $(shell python3 setup.py --version)
GITHUB_ACCESS_TOKEN := $(shell cat .github-access-token)
# Use bash or source won't work
SHELL := /bin/bash
all: docs deb
.PHONY : deb
deb:
dpkg-buildpackage -us -uc
mkdir -p dist
cp ../backy2_$(CURRENT_VERSION)_all.deb dist/
env: SETUPTOOLS_USE_DISTUTILS=stdlib
env: setup.py
python3 -mvenv env
$(PYTHON) -m ensurepip --upgrade
$(PIP) install -U setuptools
$(PYTHON) setup.py develop
$(PIP) install -r requirements_tests.txt
$(PIP) install -r requirements_docs.txt
$(PIP) install -r requirements_dev.txt
.PHONY : info
info:
@python --version
@virtualenv --version
@pip --version
@pip list
.PHONY : clean
clean:
fakeroot make -f debian/rules clean
rm -r env || true
.PHONY : test
test: info
$(PYTEST) -vv
.PHONY : smoketest
smoketest: env
$(PYTHON) smoketest.py
.PHONY : docs
docs: env
source env/bin/activate && cd docs && make clean && make html
#source env/bin/activate && ${SPHINX_MULTIVERSION} docs/source docs/build/html
#cp docs/source/_static/index.html docs/build/html
.PHONY : release
release: env deb
@echo ""
@echo "--------------------------------------------------------------------------------"
@echo Releasing Version $(CURRENT_VERSION)
$(PYTHON) setup.py sdist
# github release
@echo "--------------------------------------------------------------------------------"
@echo "Releasing at github"
git push github
# create release
curl -fsS -H "Authorization: token $(GITHUB_ACCESS_TOKEN)" --data '{"tag_name": "v$(CURRENT_VERSION)", "target_commitish": "master", "name": "$(CURRENT_VERSION)", "body": "Release $(CURRENT_VERSION)", "draft": false, "prerelease": false}' https://api.github.com/repos/tigercomputing/backy2/releases
RELEASE_ID=$$(curl -fsS -H "Authorization: token $(GITHUB_ACCESS_TOKEN)" https://api.github.com/repos/tigercomputing/backy2/releases/tags/v$(CURRENT_VERSION) | jq .id); \
curl -fi -H "Authorization: token $(GITHUB_ACCESS_TOKEN)" -H "Accept: application/vnd.github.manifold-preview" -H "Content-Type: application/octet-stream" --data-binary @dist/backy2_$(CURRENT_VERSION)_all.deb https://uploads.github.com/repos/tigercomputing/backy2/releases/$$RELEASE_ID/assets\?name\=backy2_$(CURRENT_VERSION)_all.deb; \
curl -fi -H "Authorization: token $(GITHUB_ACCESS_TOKEN)" -H "Accept: application/vnd.github.manifold-preview" -H "Content-Type: application/octet-stream" --data-binary @dist/backy2-$(CURRENT_VERSION).tar.gz https://uploads.github.com/repos/tigercomputing/backy2/releases/$$RELEASE_ID/assets\?name\=backy2_$(CURRENT_VERSION).tar.gz
.PHONY : bbb
bbb: