Skip to content

Commit 1f1e4ce

Browse files
chore(*): Rename PUBLISH to EXTERNAL_PORT
This makes the boot logic more understandable. This commit also fixes some wrong comments, about what is published and what is checked.
1 parent 451e99b commit 1f1e4ce

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

bin/boot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,22 @@ CONFD_PID=$!
7272

7373
echo deis-controller running...
7474

75-
# publish the service to etcd using the injected PORT
76-
if [[ ! -z $PUBLISH ]]; then
75+
# publish the service to etcd using the injected EXTERNAL_PORT
76+
if [[ ! -z $EXTERNAL_PORT ]]; then
7777

7878
# configure service discovery
7979
PORT=${PORT:-8000}
8080
PROTO=${PROTO:-tcp}
8181

8282
set +e
8383

84-
# wait for the service to become available on PUBLISH port
84+
# wait for the service to become available on PORT
8585
sleep 1 && while [[ -z $(netstat -lnt | awk "\$6 == \"LISTEN\" && \$4 ~ \".$PORT\" && \$1 ~ \"$PROTO.?\"") ]] ; do sleep 1; done
8686

8787
# while the port is listening, publish to etcd
8888
while [[ ! -z $(netstat -lnt | awk "\$6 == \"LISTEN\" && \$4 ~ \".$PORT\" && \$1 ~ \"$PROTO.?\"") ]] ; do
8989
etcdctl --no-sync -C $ETCD set $ETCD_PATH/host $HOST --ttl $ETCD_TTL >/dev/null
90-
etcdctl --no-sync -C $ETCD set $ETCD_PATH/port $PUBLISH --ttl $ETCD_TTL >/dev/null
90+
etcdctl --no-sync -C $ETCD set $ETCD_PATH/port $EXTERNAL_PORT --ttl $ETCD_TTL >/dev/null
9191
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
9292
done
9393

tests/controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestController(t *testing.T) {
4646
"--name", name,
4747
"--rm",
4848
"-p", port+":8000",
49-
"-e", "PUBLISH="+port,
49+
"-e", "EXTERNAL_PORT="+port,
5050
"-e", "HOST="+host,
5151
"-e", "ETCD_PORT="+etcdPort,
5252
"deis/controller:"+tag)

0 commit comments

Comments
 (0)