From cddc4afcea15d00296f3e987af6e9c13e67b9fcb Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 20 Aug 2015 23:47:11 -0400 Subject: [PATCH] Remove last outer calls to ENV files in `release` command --- plugins/00_dokku-standard/commands | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/00_dokku-standard/commands b/plugins/00_dokku-standard/commands index f5eedd538..4a95d480e 100755 --- a/plugins/00_dokku-standard/commands +++ b/plugins/00_dokku-standard/commands @@ -65,15 +65,21 @@ case "$1" in # *DEPRECATED* in v0.3.22: `pluginhook pre-release-buildstep` will be removed in future releases pluginhook pre-release-buildstep "$APP" pluginhook pre-release-buildpack "$APP" - if [[ -f "$DOKKU_ROOT/ENV" ]]; then - id=$(docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh" < "$DOKKU_ROOT/ENV") + if [[ -n $(dokku config --global --export) ]]; then + TMPFILE=$(mktemp /tmp/dokku.XXXXXX) || dokku_log_fail "Cannot create temp file using mktemp in /tmp dir" + dokku config --global --export > $TMPFILE + id=$(docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh" < "$TMPFILE") test "$(docker wait $id)" -eq 0 docker commit $id $IMAGE > /dev/null + rm -rf $TMPFILE fi - if [[ -f "$DOKKU_ROOT/$APP/ENV" ]]; then - id=$(docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/01-app-env.sh" < "$DOKKU_ROOT/$APP/ENV") + if [[ -n $(dokku config $APP --export) ]]; then + TMPFILE=$(mktemp /tmp/dokku.XXXXXX) || dokku_log_fail "Cannot create temp file using mktemp in /tmp dir" + dokku config $APP --export > $TMPFILE + id=$(docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/01-app-env.sh" < "$TMPFILE") test "$(docker wait $id)" -eq 0 docker commit $id $IMAGE > /dev/null + rm -rf $TMPFILE fi # *DEPRECATED* in v0.3.15: `pluginhook post-release` will be removed in future releases pluginhook post-release "$APP"