Wait for newly-created networks before continuing
continuous-integration/drone/push Build is passing Details

This commit is contained in:
3wc 2020-09-27 21:51:20 +02:00
parent 19df46692f
commit 9f9d4bafe9
1 changed files with 2 additions and 1 deletions

View File

@ -14,8 +14,10 @@ create_networks() {
echo "--- start create_networks ---"
IFS=',' read -ra NETWORKS <<< "$PLUGIN_NETWORKS"
for NETWORK in "${NETWORKS[@]}"; do
echo "$NETWORK"
docker -H "$REMOTE_DOCKER_HOST" \
network create --driver=overlay "$NETWORK" --scope swarm || true
until [ -n "$(docker -H "$REMOTE_DOCKER_HOST" network ls -f "name=$NETWORK" -q)" ]; do sleep 1; done
done
echo "--- end create_networks ---"
}
@ -88,7 +90,6 @@ run_plugin() {
load_deploy_key
output_versions
echo "$PLUGIN_NETWORKS"
if [ -n "$PLUGIN_NETWORKS" ]; then
create_networks
fi