Merge branch 'main' of ssh://git.autonomic.zone:2222/autonomic-cooperative/stack-ssh-deploy into main
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Luke Murphy 2020-09-27 08:07:25 +02:00
commit 6f125529b1
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 3 additions and 5 deletions

View File

@ -67,15 +67,13 @@ run_stack_wait() {
run_purge() {
echo "--- start purge ---"
docker -H "$DOCKER_HOST" stack rm "$PLUGIN_STACK"
echo "--- end purge ---"
}
run_cleanup() {
echo "--- start cleanup ---"
# See https://github.com/moby/moby/issues/30942#issuecomment-540699206
until [ -z "$(docker stack ps "$PLUGIN_STACK" -q)" ]; do sleep 1; done
docker -H "$DOCKER_HOST" system prune --all --volumes --force
docker -H "$DOCKER_HOST" secret rm "$(docker -H "$DOCKER_HOST" secret ls -q)" || true
# try and remove all secrets; Docker will leave ones which are in use
docker -H "$DOCKER_HOST" secret ls --format '{{ .Name }}' | xargs -i sh -c "echo {}; docker -H \"$DOCKER_HOST\" secret rm {} || true"
echo "--- end cleanup ---"
}