fix: ensure we write the ipaddr and port

This commit is contained in:
Jose Diaz-Gonzalez
2017-04-21 02:35:35 -06:00
committed by Michael Hobbs
parent f668bec210
commit a9e0f8b7be
3 changed files with 24 additions and 2 deletions

View File

@@ -632,8 +632,8 @@ dokku_deploy_cmd() {
# now using the new container
[[ -n "$id" ]] && echo "$id" > "$DOKKU_CONTAINER_ID_FILE"
[[ -n "$ipaddr" ]] && network-write-container-ipaddr "$APP" "$PROC_TYPE" "$CONTAINER_INDEX" "$ipaddr"
[[ -n "$port" ]] && network-write-container-port "$APP" "$PROC_TYPE" "$CONTAINER_INDEX" "$port"
[[ -n "$ipaddr" ]] && plugn trigger network-write-ipaddr "$APP" "$PROC_TYPE" "$CONTAINER_INDEX" "$ipaddr"
[[ -n "$port" ]] && plugn trigger network-write-port "$APP" "$PROC_TYPE" "$CONTAINER_INDEX" "$port"
# cleanup pre-migration files
rm -f "$DOKKU_ROOT/$APP/CONTAINER" "$DOKKU_ROOT/$APP/IP" "$DOKKU_ROOT/$APP/PORT"

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
network-write-ipaddr() {
declare desc="Writes the ipaddr to disk"
declare APP="$1" PROC_TYPE="$2" CONTAINER_INDEX="$3" IP_ADDRESS="$4"
local DOKKU_IP_FILE="$DOKKU_ROOT/$APP/IP.$PROC_TYPE.$CONTAINER_INDEX"
echo "$IP_ADDRESS" > "$DOKKU_IP_FILE"
}
network-write-ipaddr "$@"

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
network-write-port() {
declare desc="Writes the ipaddr to disk"
declare APP="$1" PROC_TYPE="$2" CONTAINER_INDEX="$3" PORT="$4"
local DOKKU_PORT_FILE="$DOKKU_ROOT/$APP/PORT.$PROC_TYPE.$CONTAINER_INDEX"
echo "$PORT" > "$DOKKU_PORT_FILE"
}
network-write-port "$@"