Merge pull request #321 from mikexstudios/remove-image-var

For #313: Do not specify both `$APP` and `$IMAGE` for base commands.
This commit is contained in:
rhy-jot committed 2013-12-18 14:18:51 -08:00
commit 693800d709
2 files changed
+15 -16

No files matched your search

+12 -13
View File
@@ -18,44 +18,44 @@ case "$1" in
echo "-----> Cleaning up ..." echo "-----> Cleaning up ..."
dokku cleanup dokku cleanup
echo "-----> Building $APP ..." echo "-----> Building $APP ..."
cat | dokku build $APP $IMAGE cat | dokku build $APP
echo "-----> Releasing $APP ..." echo "-----> Releasing $APP ..."
dokku release $APP $IMAGE dokku release $APP
echo "-----> Deploying $APP ..." echo "-----> Deploying $APP ..."
dokku deploy $APP $IMAGE dokku deploy $APP
echo "=====> Application deployed:" echo "=====> Application deployed:"
echo " $(dokku url $APP)" echo " $(dokku url $APP)"
echo echo
;; ;;
build) build)
APP="$2"; IMAGE="$3"; CACHE_DIR="$DOKKU_ROOT/$APP/cache" APP="$2"; IMAGE="app/$APP"; CACHE_DIR="$DOKKU_ROOT/$APP/cache"
id=$(cat | docker run -i -a stdin progrium/buildstep /bin/bash -c "mkdir -p /app && tar -xC /app") id=$(cat | docker run -i -a stdin progrium/buildstep /bin/bash -c "mkdir -p /app && tar -xC /app")
test $(docker wait $id) -eq 0 test $(docker wait $id) -eq 0
docker commit $id $IMAGE > /dev/null docker commit $id $IMAGE > /dev/null
[[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR [[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR
pluginhook pre-build $APP $IMAGE pluginhook pre-build $APP
id=$(docker run -d -v $CACHE_DIR:/cache $IMAGE /build/builder) id=$(docker run -d -v $CACHE_DIR:/cache $IMAGE /build/builder)
docker attach $id docker attach $id
test $(docker wait $id) -eq 0 test $(docker wait $id) -eq 0
docker commit $id $IMAGE > /dev/null docker commit $id $IMAGE > /dev/null
pluginhook post-build $APP $IMAGE pluginhook post-build $APP
;; ;;
release) release)
APP="$2"; IMAGE="$3" APP="$2"; IMAGE="app/$APP"
pluginhook pre-release $APP $IMAGE pluginhook pre-release $APP
if [[ -f "$DOKKU_ROOT/$APP/ENV" ]]; then if [[ -f "$DOKKU_ROOT/$APP/ENV" ]]; then
id=$(cat "$DOKKU_ROOT/$APP/ENV" | docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/app-env.sh") id=$(cat "$DOKKU_ROOT/$APP/ENV" | docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/app-env.sh")
test $(docker wait $id) -eq 0 test $(docker wait $id) -eq 0
docker commit $id $IMAGE > /dev/null docker commit $id $IMAGE > /dev/null
fi fi
pluginhook post-release $APP $IMAGE pluginhook post-release $APP
;; ;;
deploy) deploy)
APP="$2"; IMAGE="$3" APP="$2"; IMAGE="app/$APP"
pluginhook pre-deploy $APP $IMAGE pluginhook pre-deploy $APP
# kill the app when running # kill the app when running
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then
@@ -93,8 +93,7 @@ case "$1" in
deploy:all) deploy:all)
for app in $(ls -d $DOKKU_ROOT/*/); do for app in $(ls -d $DOKKU_ROOT/*/); do
APP=$(basename $app); APP=$(basename $app);
IMAGE="app/$APP" dokku deploy $APP
dokku deploy $APP $IMAGE
done done
;; ;;
+3 -3
View File
@@ -49,13 +49,13 @@ config_styled_hash () {
} }
config_restart_app() { config_restart_app() {
APP="$1"; IMAGE="app/$APP" APP="$1";
echo "-----> Releasing $APP ..." echo "-----> Releasing $APP ..."
dokku release $APP $IMAGE dokku release $APP
echo "-----> Release complete!" echo "-----> Release complete!"
echo "-----> Deploying $APP ..." echo "-----> Deploying $APP ..."
dokku deploy $APP $IMAGE dokku deploy $APP
echo "-----> Deploy complete!" echo "-----> Deploy complete!"
} }