replacing ruby json parsing

This commit is contained in:
Jeff Lindsay
2013-06-21 13:40:59 -07:00
parent c3aa085fb3
commit 5fd7ac4fba

View File

@@ -5,7 +5,7 @@ if [[ ! -f "$HOME/$APP/PORT" ]]; then
# First deploy
ID=$(docker run -d -p 5000 -e PORT=5000 $CONTAINER /bin/bash -c "/start web")
echo $ID > "$HOME/$APP/CONTAINER"
PORT=$(docker inspect $ID | ruby -e 'require"json";puts JSON.parse(STDIN.read)[0]["NetworkSettings"]["PortMapping"]["5000"]')
PORT=$(docker port $ID 5000)
echo $PORT > "$HOME/$APP/PORT"
if [[ -f "$HOME/DOMAIN" ]]; then
HOSTNAME="${APP/\//-}.$(< "$HOME/DOMAIN")"