Skip to content

Commit d9a1e2d

Browse files
committed
Fix issue where port was incorrectly being set upon app link
Closes Kloadut#40 Closes Kloadut#61
1 parent 64f8c81 commit d9a1e2d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

commands

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,13 @@ case "$1" in
190190
exit 1
191191
fi
192192
DB_PASSWORD=$(cat "$DOKKU_ROOT/.postgresql/pwd_$3")
193+
# get_postgresql_port expects $APP to be the name of the db so we temporarily change
194+
APP_CACHE=$APP
195+
APP=$3
196+
PORT=$(get_postgresql_port)
193197
IP=$(get_postgresql_ip)
194198
PORT=$(get_postgresql_port)
199+
APP=$APP_CACHE
195200
# Link database using dokku command
196201
dokku config:set $APP "DATABASE_URL=postgres://root:$DB_PASSWORD@$IP:$PORT/db"
197202
echo

0 commit comments

Comments
 (0)