From 171b627e0a200c609e148d47f76096dc4187176e Mon Sep 17 00:00:00 2001 From: 3wc <3wc.git@doesthisthing.work> Date: Fri, 25 Sep 2020 16:11:48 +0200 Subject: [PATCH] Wait for success using docker-stack-wait-deploy --- plugin.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugin.sh b/plugin.sh index 63eb9b2..0a970ca 100755 --- a/plugin.sh +++ b/plugin.sh @@ -26,10 +26,16 @@ run_stack_deploy() { stack deploy -c "$PLUGIN_COMPOSE" "$PLUGIN_STACK" } +run_stack_wait() { + export DOCKER_HOST="ssh://$PLUGIN_USER@$PLUGIN_HOST:$PLUGIN_PORT" + docker run --rm vitalets/docker-stack-wait-deploy | sed 's/True/true/' | bash -x /dev/stdin "$PLUGIN_STACK" +} + run_plugin() { echo "--- start deployment ---" load_deploy_key run_stack_deploy + run_stack_wait echo "--- end deployment ---" }