forked from muccg/docker-devpi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-entrypoint.sh
39 lines (30 loc) · 985 Bytes
/
docker-entrypoint.sh
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
#!/bin/bash
function defaults {
: ${DEVPI_SERVERDIR="/data/server"}
: ${DEVPI_CLIENTDIR="/data/client"}
echo "DEVPI_SERVERDIR is ${DEVPI_SERVERDIR}"
echo "DEVPI_CLIENTDIR is ${DEVPI_CLIENTDIR}"
export DEVPI_SERVERDIR DEVPI_CLIENTDIR
}
function initialise_devpi {
echo "[RUN]: Initialise devpi-server"
devpi-server --restrict-modify root --start --host 127.0.0.1 --port 3141 --init
devpi-server --status
devpi use http://localhost:3141
devpi login root --password=''
devpi user -m root password="${DEVPI_PASSWORD}"
devpi index -y -c public pypi_whitelist='*'
devpi-server --stop
devpi-server --status
}
defaults
if [ "$1" = 'devpi' ]; then
if [ ! -f $DEVPI_SERVERDIR/.serverversion ]; then
initialise_devpi
fi
echo "[RUN]: Launching devpi-server"
exec devpi-server --restrict-modify root --host 0.0.0.0 --port 3141
fi
echo "[RUN]: Builtin command not provided [devpi]"
echo "[RUN]: $@"
exec "$@"