Permalink
Browse files

Only reload the container if it's already running. Don't pull

a container if it doesn't exist. Don't do anything.
  • Loading branch information...
darron committed Sep 3, 2014
1 parent 22ab5ca commit a4c6bb0add8c37064ed6e716ec9addb89368c38f
Showing with 12 additions and 2 deletions.
  1. +12 −2 commands
View
@@ -86,6 +86,16 @@ remove_environment_variables ()
/usr/bin/octo config:rm $1/MYSQL_HOSTNAME
}
reload_container ()
{
# Only reload the container if it's already running.
BASE="$1"
FOUND=$(sudo docker ps | grep "$BUILD_ORG_NAME/$BASE")
if [ $? = 0 ]; then
/usr/bin/octo reload $BASE
fi
}
case "$1" in
mysql:create)
@@ -100,7 +110,7 @@ case "$1" in
reload_mysql_tables
link_environment_variables "$USER" "$PASSWORD"
show_environment_variables "$USER"
octo reload $USER
reload_container "$USER"
else
echo "Usage: octo mysql create {container}"
fi
@@ -114,7 +124,7 @@ case "$1" in
drop_mysqL_user "$USER"
reload_mysql_tables
remove_environment_variables "$USER"
octo reload $USER
reload_container "$USER"
else
echo "Usage: octo mysql delete {container}"
fi

0 comments on commit a4c6bb0

Please sign in to comment.