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

View file

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