Skip to content

Commit 37964ae

Browse files
Gabriel MonroyMatthew Fisher
authored andcommitted
chore(builder): add debug, move confd loop before daemon execs
1 parent ba19ac2 commit 37964ae

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

builder/bin/boot

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
# This script is designed to be run inside the container
44
#
55

6+
# fail hard and fast even on pipelines
7+
set -eo pipefail
8+
9+
# set debug based on envvar
10+
[[ $DEBUG ]] && set -x
11+
612
# configure etcd
713
export ETCD=${ETCD:-172.17.42.1:4001}
814
export ETCD_PATH=${ETCD_PATH:-/deis/builder}
915
export ETCD_TTL=${ETCD_TTL:-10}
1016

11-
# fail hard and fast even on pipelines
12-
set -eo pipefail
13-
1417
# wait for etcd to be available
1518
until etcdctl -C $ETCD ls >/dev/null; do
1619
echo "waiting for etcd at $ETCD..."
@@ -31,6 +34,10 @@ until confd -onetime -node $ETCD -config-file /app/confd.toml; do
3134
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
3235
done
3336

37+
# spawn confd in the background to update services based on etcd changes
38+
confd -node $ETCD -config-file /app/confd.toml &
39+
CONFD_PID=$!
40+
3441
# remove any pre-existing docker.sock
3542
test -e /var/run/docker.sock && rm -f /var/run/docker.sock
3643

@@ -58,10 +65,6 @@ function on_exit() {
5865
}
5966
trap on_exit INT TERM EXIT
6067

61-
# spawn confd in the background to update services based on etcd changes
62-
confd -node $ETCD -config-file /app/confd.toml &
63-
CONFD_PID=$!
64-
6568
# publish the service to etcd using the injected HOST and PORT
6669
if [[ ! -z $PUBLISH ]]; then
6770

builder/conf.d/authorized_keys.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ git = 1000
66
mode = "0600"
77
keys = [
88
"/deis/builder/users",
9-
]
10-
#check_cmd = "cat {{ .src }}"
11-
#reload_cmd = "/usr/sbin/service nginx restart"
9+
]

0 commit comments

Comments
 (0)