Merge branch 'master' into 1091_mh-switch-to-herokuish
This commit is contained in:
@@ -8,7 +8,7 @@ case "$1" in
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
|
||||
APP="$2"; CONTAINER_IDS=$(get_container_ids $APP)
|
||||
APP="$2"; CONTAINER_IDS=$(get_app_container_ids $APP)
|
||||
! (is_deployed $APP) && echo "App $APP has not been deployed" && exit 0
|
||||
|
||||
for CID in $CONTAINER_IDS; do
|
||||
@@ -18,12 +18,10 @@ case "$1" in
|
||||
|
||||
ps:start)
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
|
||||
APP="$2"; CONTAINER_IDS=( $(get_container_ids $APP) )
|
||||
verify_app_name "$2"; APP="$2"
|
||||
! (is_deployed $APP) && echo "App $APP has not been deployed" && exit 0
|
||||
|
||||
if [[ "$(docker ps -q --no-trunc| grep -q ${CONTAINER_IDS[0]}; echo $?)" != "0" ]]; then
|
||||
if ! (is_app_running $APP); then
|
||||
release_and_deploy $APP
|
||||
else
|
||||
echo "App $APP already running"
|
||||
@@ -34,15 +32,13 @@ case "$1" in
|
||||
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
|
||||
verify_app_name "$2"
|
||||
|
||||
APP="$2"; CONTAINER_IDS=$(get_container_ids $APP)
|
||||
APP="$2"; CONTAINER_IDS=$(get_app_container_ids $APP)
|
||||
! (is_deployed $APP) && echo "App $APP has not been deployed" && exit 0
|
||||
|
||||
CONTAINER_IDS_EGREP_PATTERN=$(echo $CONTAINER_IDS | xargs | sed -e "s: :|:g")
|
||||
if [[ "$(docker ps -q --no-trunc| egrep -q $CONTAINER_IDS_EGREP_PATTERN; echo $?)" = "0" ]]; then
|
||||
DOKKU_APP_RUNNING_CONTAINER_IDS=$(get_app_running_container_ids $APP)
|
||||
if [[ -n "$DOKKU_APP_RUNNING_CONTAINER_IDS" ]]; then
|
||||
echo "Stopping $APP ..."
|
||||
for CID in $CONTAINER_IDS;do
|
||||
docker stop $CID > /dev/null
|
||||
done
|
||||
docker stop $DOKKU_APP_RUNNING_CONTAINER_IDS > /dev/null || true
|
||||
else
|
||||
echo "App $APP already stopped"
|
||||
fi
|
||||
@@ -105,14 +101,14 @@ case "$1" in
|
||||
|
||||
help | ps:help)
|
||||
cat && cat<<EOF
|
||||
ps <app> List processes running in app container(s)
|
||||
ps:scale <app> <proc>=<count> [<proc>=<count>] Set how many processes of a given process to run
|
||||
ps:start <app> Start app container(s)
|
||||
ps:stop <app> Stop app container(s)
|
||||
ps:rebuild <app> Rebuild an app
|
||||
ps:rebuildall Rebuild all apps
|
||||
ps:restart <app> Restart app container(s)
|
||||
ps:restartall Restart all deployed app containers
|
||||
ps <app>, List processes running in app container(s)
|
||||
ps:scale <app> <proc>=<count> [<proc>=<count>], Set how many instances of a given process to run
|
||||
ps:start <app>, Start app container(s)
|
||||
ps:stop <app>, Stop app container(s)
|
||||
ps:rebuild <app>, Rebuild an app
|
||||
ps:rebuildall, Rebuild all apps
|
||||
ps:restart <app>, Restart app container(s)
|
||||
ps:restartall, Restart all deployed app containers
|
||||
EOF
|
||||
;;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user