use auth flags if provide registry

This commit is contained in:
Dmitriy Pleshevskiy 2023-03-09 15:16:51 +03:00
parent 91bf64d3ab
commit 1d9e59564c
Signed by: pleshevskiy
GPG Key ID: 79C4487B44403985
1 changed files with 4 additions and 1 deletions

View File

@ -2,13 +2,16 @@
set -ex
if [ -n "${PLUGIN_REGISTRY:-$ORG_REGISTRY}" ]; then
AUTH_FLAGS=--with-registry-auth
fi
if [ -n "$PLUGIN_PASSWORD" ]; then
echo -n "$PLUGIN_PASSWORD" | \
docker login \
-u "$PLUGIN_USERNAME" \
--password-stdin \
${PLUGIN_REGISTRY:-$ORG_REGISTRY}
AUTH_FLAGS=--with-registry-auth
fi
docker stack deploy \