-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathserve.sh
More file actions
executable file
·37 lines (28 loc) · 861 Bytes
/
serve.sh
File metadata and controls
executable file
·37 lines (28 loc) · 861 Bytes
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
#!/usr/bin/env bash
set -e
[[ -f $DEVPI_SERVERDIR/.serverversion ]] || initialize=yes
# Properly shutdown devpi server
shutdown() {
devpi-server --stop # Kill server
kill -SIGTERM $TAIL_PID # Kill log tailing
}
trap shutdown SIGTERM SIGINT
# Need $DEVPI_SERVERDIR
devpi-server --start --host 0.0.0.0 --port $DEVPI_PORT --theme $DEVPI_THEME
DEVPI_LOGS=$DEVPI_SERVERDIR/.xproc/devpi-server/xprocess.log
devpi use http://localhost:$DEVPI_PORT
if [[ $initialize = yes ]]; then
# Set root password
devpi login root --password=''
devpi user -m root password="${DEVPI_PASSWORD}"
# devpi index -y -c public pypi_whitelist='*'
fi
# Authenticate for later commands
devpi login root --password="${DEVPI_PASSWORD}"
tail -f $DEVPI_LOGS &
TAIL_PID=$!
# Wait until tail is killed
wait $TAIL_PID
# Set proper exit code
wait $DEVPI_PID
EXIT_STATUS=$?