shaving lines

This commit is contained in:
Jeff Lindsay
2013-06-10 18:55:35 -07:00
parent c43b2af99e
commit 50852dad3e

View File

@@ -1,16 +1,14 @@
#!/bin/bash
APP="$1"; CONTAINER="$2"
[[ -f "$HOME/DOMAIN" ]] && DOMAIN=$(< "$HOME/DOMAIN")
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)["NetworkSettings"]["PortMapping"]["5000"]')
echo $PORT > "$HOME/$APP/PORT"
if [[ $DOMAIN ]]; then
HOSTNAME="$APP.$DOMAIN"
if [[ -f "$HOME/DOMAIN" ]]; then
HOSTNAME="$APP.$(< "$HOME/DOMAIN")"
$HOME/nginx-app-conf $APP $PORT $HOSTNAME > $HOME/$APP/nginx.conf
nc -U $HOME/reload-nginx
else