-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
41 lines (34 loc) · 798 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
36
37
38
39
40
41
export MIRROR_URL := https://pypi.tuna.tsinghua.edu.cn/simple/
build:
docker build \
-t pypi-mirror \
-f config/Dockerfile .
up:
docker run -itd --rm \
--name pypi-mirror \
-p 0.0.0.0:8080:3141 \
-v $$(pwd)/cache:/cache \
-e MIRROR_URL=$(MIRROR_URL) \
-e CACHE_DIR=/cache \
pypi-mirror
down:
docker stop pypi-mirror
sh:
docker run -it --rm \
--name pypi-mirror \
--entrypoint /bin/sh \
pypi-mirror
# testcases
test-devpi:
docker run -it --rm \
--name test-pypi-mirror \
-e MIRROR_URL=$(MIRROR_URL) \
-e CACHE_DIR=/cache \
pypi-mirror
test-userdefine-command:
docker run -it --rm \
--name test-pypi-mirror \
-e MIRROR_URL=$(MIRROR_URL) \
-e CACHE_DIR=/cache \
-e COMMAND="--include-mirrored-files --serverdir=/cache --proxy-timeout=10 --host=0.0.0.0" \
pypi-mirror