Added countdown time to docker-stack-rm.
Added check for compose plugin and legacy docker-compose.
This commit is contained in:
parent
de73b968bc
commit
f5d8b3422a
|
@ -18,5 +18,5 @@ RUNNING_STACK=$( echo $PARENT_DIR | cut -d " " -f1 )
|
|||
# if we found a running stack, bring it down.
|
||||
echo "Removing stack $RUNNING_STACK..."
|
||||
docker stack rm $RUNNING_STACK
|
||||
echo "Waiting for 30 seconds for services to terminate..."
|
||||
sleep 30
|
||||
WAIT=30
|
||||
for i in `seq $WAIT -1 1` ; do echo -ne "\rWaiting $i seconds for services to terminate..." ; sleep 1 ; done
|
|
@ -1,5 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
COMPOSE_PLUGIN=$(docker compose >/dev/null 2>&1; if [ "$?" == "0" ]; then echo "true"; else echo "false"; fi)
|
||||
COMPOSE_LEGACY=$(docker-compose >/dev/null 2>&1; if [ "$?" == "0" ]; then echo "true"; else echo "false"; fi)
|
||||
|
||||
case "true" in
|
||||
$COMPOSE_PLUGIN)
|
||||
echo "using docker compose"
|
||||
COMPOSE="docker compose"
|
||||
;;
|
||||
$COMPOSE_LEGACY)
|
||||
echo "using docker-compose"
|
||||
COMPOSE="docker-compose"
|
||||
;;
|
||||
*)
|
||||
echo "No docker-compose found."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ ! -z $1 ]; then
|
||||
START_DIR="$1"
|
||||
else
|
||||
|
@ -19,7 +37,7 @@ do
|
|||
echo "Updating $CURRENT_DIR..."
|
||||
cd $CURRENT_DIR
|
||||
if [ ! -f ".update.ignore" ]; then
|
||||
docker-compose pull --no-parallel && docker-compose up -d --remove-orphans 2>&1
|
||||
$COMPOSE pull --no-parallel && $COMPOSE up -d --remove-orphans 2>&1
|
||||
else
|
||||
echo "Stack flagged for ignore updates"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue
Block a user