-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathrun.sh
executable file
·36 lines (30 loc) · 1.2 KB
/
run.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
#!/bin/bash
#
# run.sh
#
# Author: Matteo Cerutti <[email protected]>
#
PUPPET_FORGE_SERVER_PORT=${PUPPET_FORGE_SERVER_PORT:-8080}
PUPPET_FORGE_SERVER_CACHEDIR=${PUPPET_FORGE_SERVER_CACHEDIR:-$PUPPET_FORGE_SERVER_BASEDIR/cache}
PUPPET_FORGE_SERVER_OPTS=
if [ -n "$PUPPET_FORGE_SERVER_MODULEDIR" ]; then
for moduledir in $PUPPET_FORGE_SERVER_MODULEDIR; do
PUPPET_FORGE_SERVER_OPTS="$PUPPET_FORGE_SERVER_OPTS --module-dir $moduledir"
mkdir -p $moduledir
done
fi
if [ -n "$PUPPET_FORGE_SERVER_PROXY" ]; then
for proxy in $PUPPET_FORGE_SERVER_PROXY; do
PUPPET_FORGE_SERVER_OPTS="$PUPPET_FORGE_SERVER_OPTS --proxy $proxy"
done
fi
PUPPET_FORGE_SERVER_DEBUG=${PUPPET_FORGE_SERVER_DEBUG:-0}
[ $PUPPET_FORGE_SERVER_DEBUG -eq 1 ] && PUPPET_FORGE_SERVER_OPTS="$PUPPET_FORGE_SERVER_OPTS --debug"
# prepare directories
mkdir -p $PUPPET_FORGE_SERVER_CACHEDIR
if [ -n "$PUPPET_FORGE_SERVER_LOGDIR" ]; then
mkdir -p $PUPPET_FORGE_SERVER_LOGDIR
PUPPET_FORGE_SERVER_OPTS="$PUPPET_FORGE_SERVER_OPTS --log-dir $PUPPET_FORGE_SERVER_LOGDIR"
fi
echo "Starting puppet-forge-server"
exec puppet-forge-server --port $PUPPET_FORGE_SERVER_PORT --cache-basedir $PUPPET_FORGE_SERVER_CACHEDIR $PUPPET_FORGE_SERVER_OPTS