-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
35 lines (27 loc) · 840 Bytes
/
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
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright (C) 2021 Sean Anderson <[email protected]>
PYTHON := python3
PROD := trends.tf
PROD_PREFIX := /srv/uwsgi/trends
PIP := $(PROD_PREFIX)/venv/bin/pip $(if $(V),,-q)
.PHONY: FORCE
FORCE:
export SOURCE_DATE_EPOCH := $(shell date +%s)
PACKAGE := dist/$(shell $(PYTHON) setup.py --fullname)-py3-none-any.whl
$(PACKAGE): FORCE
$(PYTHON) setup.py $(if $(V),,-q) bdist_wheel --plat-name any
.PHONY: build
build: $(PACKAGE)
.PHONY: deploy deploy/%
deploy/%:
git push --force ssh://$(PROD)$(PROD_PREFIX) $*:master
ssh $(PROD) '$(PIP) install -r $(PROD_PREFIX)/requirements.txt && \
$(PIP) install -e $(PROD_PREFIX) && \
sudo systemctl reload uwsgi'
deploy: deploy/HEAD
.PHONY: clean
clean:
$(PYTHON) setup.py clean --all
.PHONY: distclean
distclean: clean
rm -f *.deb *.pkg.tar.zst