-
-
Notifications
You must be signed in to change notification settings - Fork 498
/
Copy pathMakefile
54 lines (39 loc) · 1.03 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
AUTHOR := dwisiswant0
APP := apkleaks
IMAGE := $(AUTHOR)/$(APP)
VERSION := $(shell cat VERSION | tr -d '\n')
PACKAGE := $(APP)-$(shell echo $(VERSION) | cut -c 2-)
VENV := venv
PYTHON := python3
# PIP := pip3
ifneq ($(wildcard $(VENV)),)
PYTHON = $(VENV)/bin/python3
# PIP = $(VENV)/bin/pip3
endif
venv:
python3 -m venv $(VENV)
setup:
$(PYTHON) -m pip install -r requirements.txt
$(PYTHON) -m pip install build twine
setup-venv: venv
setup-venv: PYTHON = $(VENV)/bin/python3
setup-venv: setup
build-package:
@$(PYTHON) -m build
check-package:
@$(PYTHON) -m twine check dist/$(PACKAGE)*
upload-package:
@$(PYTHON) -m twine upload dist/$(PACKAGE)*
pypi: check-package build-package
build-images:
@docker build -t $(IMAGE):latest .
@docker tag $(IMAGE):latest $(IMAGE):$(VERSION)
upload-images:
@docker push $(IMAGE):latest
@docker push $(IMAGE):$(VERSION)
docker: build-images
build-all: build-package build-images
upload-all: upload-package upload-images
clean:
@rm -rfv dist/ venv/
@docker image rm -f dwisiswant0/apkleaks