rolled into dokku

This commit is contained in:
Jeff Lindsay
2013-06-30 08:51:28 -05:00
parent 183d8f6ed3
commit c08f3233e9
2 changed files with 0 additions and 39 deletions

View File

@@ -1,14 +0,0 @@
#!/bin/bash
set -e
NAME="$1"
# Place the app inside the container
ID=$(cat | docker run -i -a stdin progrium/buildstep /bin/bash -c "mkdir -p /app && tar -xC /app")
test $(docker wait $ID) -eq 0
docker commit $ID $NAME > /dev/null
# Run the builder script and attach to view output
ID=$(docker run -d $NAME /build/builder)
docker attach $ID
test $(docker wait $ID) -eq 0
docker commit $ID $NAME > /dev/null

View File

@@ -1,25 +0,0 @@
#!/bin/bash
APP="$1"; CONTAINER="$2"
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 port $ID 5000)
echo $PORT > "$HOME/$APP/PORT"
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
HOSTNAME="$(< "$HOME/HOSTNAME"):$PORT"
fi
echo $HOSTNAME > "$HOME/$APP/HOSTNAME"
else
# Regular deploy
OLDID=$(< "$HOME/$APP/CONTAINER")
docker kill $OLDID > /dev/null
PORT=$(< "$HOME/$APP/PORT")
ID=$(docker run -d -p ":$PORT" -e "PORT=$PORT" $CONTAINER /bin/bash -c "/start web")
echo $ID > "$HOME/$APP/CONTAINER"
fi