From a9e0f8b7beadf1bf47fcc7f2a9e530433d6b7302 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 21 Apr 2017 02:35:35 -0600 Subject: [PATCH] fix: ensure we write the ipaddr and port --- plugins/common/functions | 4 ++-- plugins/network/network-write-ipaddr | 11 +++++++++++ plugins/network/network-write-port | 11 +++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100755 plugins/network/network-write-ipaddr create mode 100755 plugins/network/network-write-port diff --git a/plugins/common/functions b/plugins/common/functions index 816e59391..74aa7015b 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -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" diff --git a/plugins/network/network-write-ipaddr b/plugins/network/network-write-ipaddr new file mode 100755 index 000000000..9f544f73e --- /dev/null +++ b/plugins/network/network-write-ipaddr @@ -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 "$@" diff --git a/plugins/network/network-write-port b/plugins/network/network-write-port new file mode 100755 index 000000000..f43a1b784 --- /dev/null +++ b/plugins/network/network-write-port @@ -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 "$@"