forked from outscale/osc-bsu-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (36 loc) · 1.29 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
PYTHON3=$$(which python3)
PYTHONFILES=$$(find osc_bsu_backup -iname '*.py')
PYTHONUTESTFILES=$$(find tests -iname '*.py')
VERSION=$$(git describe --abbrev=0 --tags)
PWD=$$(pwd)
virtualenv:
$(PYTHON3) -m venv venv
clean:
rm -rf venv dist build osc_bsu_backup.egg-info
develop: virtualenv
./venv/bin/python setup.py develop
unit: virtualenv format develop
./venv/bin/python -m unittest -f -v $$(ls tests/unit/test_*.py)
integration: virtualenv format develop
./venv/bin/python -m unittest -f -v $$(ls tests/integration/test_*.py)
wheel: virtualenv
./venv/bin/pip install wheel && ./venv/bin/python setup.py bdist_wheel
format: virtualenv
./venv/bin/pip install black && ./venv/bin/black $(PYTHONFILES) && ./venv/bin/black $(PYTHONUTESTFILES)
docker-image:
docker build -t osc-bsu-backup:$(VERSION) .
docker-develop: docker-image
docker run \
-v $(PWD)/dist:/root/osc-bsu-backup/pkg \
osc-bsu-backup:$(VERSION) develop
docker-unit: docker-image
docker run osc-bsu-backup:$(VERSION) unit
docker-integration: docker-image
docker run \
-e "AWS_ACCESS_KEY_ID=$(AWS_ACCESS_KEY_ID)" \
-e "AWS_SECRET_ACCESS_KEY=$(AWS_SECRET_ACCESS_KEY)" \
osc-bsu-backup:$(VERSION) integration
docker-wheel: docker-image
docker run \
-v $(PWD)/dist:/root/osc-bsu-backup/pkg \
osc-bsu-backup:$(VERSION) wheel