-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
44 lines (35 loc) · 1.24 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
.PHONY: test
test: autoversion venv mypy
venv/bin/pre-commit run --all-files
venv/bin/pre-commit install -f --install-hooks
.PHONY: mypy
mypy: venv
venv/bin/mypy approve.py
.PHONY: builddeb
builddeb: autoversion
dpkg-buildpackage -us -uc
.PHONY: package
package: package_stretch
.PHONY: package_%
package_%: dist
docker run -e "DIST_UID=$(shell id -u)" -e "DIST_GID=$(shell id -g)" -v $(CURDIR):/mnt:rw "docker.ocf.berkeley.edu/theocf/debian:$*" /mnt/build-in-docker "$*"
dist:
mkdir -p "$@"
.PHONY: autoversion
autoversion:
date +%Y.%m.%d.%H.%M-deb`lsb_release -rs`-git`git rev-list -n1 HEAD | cut -b1-8` > .version
rm -f debian/changelog
DEBFULLNAME="Open Computing Facility" DEBEMAIL="[email protected]" VISUAL=true \
dch -v `sed s/-/+/g .version` -D stable --no-force-save-on-release \
--create --package "ocf-approve" "Package for Debian."
venv: autoversion vendor/venv-update requirements.txt requirements-dev.txt setup.py
vendor/venv-update \
venv= venv -ppython3 \
install= -r requirements.txt -r requirements-dev.txt -e .
.PHONY: clean
clean:
rm -rf debian/*.debhelper debian/*.log dist dist_*
.PHONY: update-requirements
update-requirements: venv
venv/bin/upgrade-requirements
sed -i 's/^ocflib==.*/ocflib/' requirements.txt