backup-tool/Makefile

42 lines
738 B
Makefile
Raw Normal View History

2021-01-15 14:14:13 +01:00
# =====CONFIG=====
# Devop environment runs in 3.8
2021-04-24 19:27:33 +02:00
# TODO switch this to python3.6
PYTHON=python3.9
2021-01-15 14:14:13 +01:00
# =====RECIPES=====
2021-04-24 19:27:33 +02:00
.venv/bin/activate: setup.py
2021-01-15 14:14:13 +01:00
'$(PYTHON)' -m venv .venv
2021-04-24 19:27:33 +02:00
.venv/bin/pip install -e .[dev]
2021-01-15 14:14:13 +01:00
venv: .venv/bin/activate
2021-01-15 14:14:13 +01:00
.PHONY: venv
format: venv
2021-04-24 19:27:33 +02:00
@ .venv/bin/black setup.py app/*.py app/**/*.py
2021-01-15 14:14:13 +01:00
.PHONY: format
clean:
rm -rf .venv
rm backup_tool
.PHONY: clean
backup_tool:
@ cd app && \
zip -r ../app.zip * \
-x "__pycache__/*" "**/__pycache__/*" ".vim/*" "**/.vim/*"
@ echo "#!/usr/bin/env python3" | cat - app.zip > backup_tool
@ chmod a+x backup_tool
@ rm app.zip
app: backup_tool
.PHONY: app
install: app
cp backup_tool /usr/local/bin
2021-04-24 19:27:33 +02:00
.PHONY: install
2021-04-24 19:38:03 +02:00
test: venv tox.ini
@ .venv/bin/tox
.PHONY: test