Re-work DOCKER_HOST usage
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Luke Murphy 2020-09-25 20:19:10 +02:00
parent f55ecf5d45
commit 7631f09aa6
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 5 additions and 3 deletions

View File

@ -8,7 +8,7 @@ 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"
DOCKER_HOST="ssh://$PLUGIN_USER@$PLUGIN_HOST:$PLUGIN_PORT"
generate_secrets() {
echo "--- start secrets ---"
@ -44,11 +44,13 @@ output_versions(){
run_stack_deploy() {
echo "--- start deploy ---"
docker stack deploy -c "$PLUGIN_COMPOSE" "$PLUGIN_STACK"
docker -H "$DOCKER_HOST" stack deploy -c "$PLUGIN_COMPOSE" "$PLUGIN_STACK"
echo "--- end deploy ---"
}
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 /dev/stdin "$PLUGIN_STACK"
@ -56,7 +58,7 @@ run_stack_wait() {
run_purge() {
echo "--- start purge ---"
docker prune --all --volumes --force
docker -H "$DOCKER_HOST" prune --all --volumes --force
echo "--- end purge ---"
}