You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.2 KiB
47 lines
1.2 KiB
#!/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
|
|
devpi-server --status
|
|
devpi use http://localhost:3141
|
|
|
|
# Check the root password has been changed
|
|
if devpi login root --password='' > /dev/null; then
|
|
devpi login root --password=''
|
|
devpi user -m root password="${DEVPI_PASSWORD}"
|
|
devpi index -y -c public pypi_whitelist='*'
|
|
else
|
|
echo root password already changed
|
|
fi
|
|
|
|
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"
|
|
devpi-server --restrict-modify root --host 0.0.0.0 --port 3141 2>&1 | tee /data/server/devpi.log
|
|
exit $?
|
|
fi
|
|
|
|
echo "[RUN]: Builtin command not provided [devpi]"
|
|
echo "[RUN]: $@"
|
|
|
|
exec "$@"
|