Separate purge/cleanup and try sleep hack
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
ed714f8cf5
commit
feba68f11e
12
plugin.sh
12
plugin.sh
|
@ -58,10 +58,18 @@ run_stack_wait() {
|
||||||
|
|
||||||
run_purge() {
|
run_purge() {
|
||||||
echo "--- start purge ---"
|
echo "--- start purge ---"
|
||||||
docker -H "$DOCKER_HOST" system prune --all --volumes --force
|
docker -H "$DOCKER_HOST" stack rm "$PLUGIN_STACK"
|
||||||
|
# See https://github.com/moby/moby/issues/30942#issuecomment-540699206
|
||||||
|
until [ -z "$(docker stack ps "$PLUGIN_STACK" -q)" ]; do sleep 1; done
|
||||||
echo "--- end purge ---"
|
echo "--- end purge ---"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run_cleanup() {
|
||||||
|
echo "--- start cleanup ---"
|
||||||
|
docker -H "$DOCKER_HOST" system prune --all --volumes --force
|
||||||
|
echo "--- end cleanup ---"
|
||||||
|
}
|
||||||
|
|
||||||
run_plugin() {
|
run_plugin() {
|
||||||
echo "--- start ssh-stack-deploy ---"
|
echo "--- start ssh-stack-deploy ---"
|
||||||
load_deploy_key
|
load_deploy_key
|
||||||
|
@ -77,6 +85,8 @@ run_plugin() {
|
||||||
if [ "$PLUGIN_PURGE" == "true" ]; then
|
if [ "$PLUGIN_PURGE" == "true" ]; then
|
||||||
run_purge
|
run_purge
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
run_cleanup
|
||||||
echo "--- end ssh-stack-deploy ---"
|
echo "--- end ssh-stack-deploy ---"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue