-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
53 lines (42 loc) · 1.71 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
define expand_version
${1} ${shell echo ${1} | cut -f 1,2 -d .} ${shell echo ${1} | cut -f 1 -d .}
endef
TOX_VERSION := $(shell sed -ne 's/tox==//p' requirements.in)
TOX_VERSIONS := $(call expand_version,${TOX_VERSION})
IMAGE_VERSION := $(shell git describe)
IMAGE_VERSIONS := $(call expand_version,${IMAGE_VERSION})
ifdef PLATFORM
PLATFORM_ARG := --platform ${PLATFORM}
endif
build:
docker build --no-cache --pull ${PLATFORM_ARG} -t 31z4/tox .
test-all: test-minimal test-minimal-custom test-minimal-flask
test-minimal:
docker run -v ${CURDIR}/tests/minimal:/tests -it --rm ${PLATFORM_ARG} 31z4/tox
test-minimal-custom:
docker build ${PLATFORM_ARG} -t 31z4/tox-test-minimal-custom -f tests/minimal-custom/Dockerfile tests/minimal-custom
docker run -v ${CURDIR}/tests/minimal-custom:/tests -it --rm ${PLATFORM_ARG} 31z4/tox-test-minimal-custom
test-minimal-flask:
docker build ${PLATFORM_ARG} -t 31z4/tox-test-minimal-flask -f tests/minimal-flask/Dockerfile tests/minimal-flask
docker run -it --rm ${PLATFORM_ARG} 31z4/tox-test-minimal-flask run-parallel --skip-env style\|typing
buildx-and-push:
tag_args="-t 31z4/tox:latest" ; \
for tv in ${TOX_VERSIONS} ; do \
tag_args="$$tag_args -t 31z4/tox:$$tv" ; \
for iv in ${IMAGE_VERSIONS} ; do \
tag_args="$$tag_args -t 31z4/tox:$$tv-$$iv" ; \
done ; \
done; \
docker buildx build --platform linux/amd64,linux/arm64/v8 --no-cache --pull --push $$tag_args .
tags:
@tags="latest"; \
for tv in ${TOX_VERSIONS} ; do \
tags="$$tv, $$tags" ; \
for iv in ${IMAGE_VERSIONS} ; do \
tags="$$tv-$$iv, $$tags" ; \
done ; \
done; \
echo "Tags: $$tags"
@echo "GitCommit: $$(git rev-list -n 1 ${IMAGE_VERSION})"
tox-upgrade:
pip-compile --generate-hashes requirements.in