From efa7f0032080dd6fc9f894b5c94ea97cd1daf715 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Fri, 25 Sep 2020 20:03:10 +0200 Subject: [PATCH] Use global DOCKER_HOST --- plugin.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugin.sh b/plugin.sh index a0d89c3..224094c 100755 --- a/plugin.sh +++ b/plugin.sh @@ -5,8 +5,11 @@ set -e PLUGIN_COMPOSE=${PLUGIN_COMPOSE:-compose.yml} PLUGIN_HOST=${PLUGIN_HOST:-swarm.autonomic.zone} PLUGIN_PORT=${PLUGIN_PORT:-222} +PLUGIN_PURGE=${PLUGIN_PURGE:-"false"} PLUGIN_USER=${PLUGIN_USER:-drone} +export DOCKER_HOST="ssh://$PLUGIN_USER@$PLUGIN_HOST:$PLUGIN_PORT" + generate_secrets() { echo "--- start secrets ---" # FIXME 3wc: use the yq docker image instead; couldn't easily get it working @@ -36,9 +39,10 @@ run_stack_deploy() { docker version echo "--- end docker info ---" - docker \ - -H "ssh://$PLUGIN_USER@$PLUGIN_HOST:$PLUGIN_PORT" \ - stack deploy -c "$PLUGIN_COMPOSE" "$PLUGIN_STACK" +run_stack_deploy() { + echo "--- start deploy ---" + docker stack deploy -c "$PLUGIN_COMPOSE" "$PLUGIN_STACK" + echo "--- end deploy ---" } run_stack_wait() {