This repository has been archived on 2024-07-25. You can view files and clone it, but cannot push or open issues or pull requests.
docker_stack/entrypoint.sh

22 lines
429 B
Bash
Raw Normal View History

2022-06-06 16:46:25 +03:00
#!/bin/sh
set -ex
2023-03-09 15:16:51 +03:00
if [ -n "${PLUGIN_REGISTRY:-$ORG_REGISTRY}" ]; then
AUTH_FLAGS=--with-registry-auth
fi
2022-06-06 16:46:25 +03:00
if [ -n "$PLUGIN_PASSWORD" ]; then
2022-06-07 14:59:39 +03:00
echo -n "$PLUGIN_PASSWORD" | \
docker login \
-u "$PLUGIN_USERNAME" \
--password-stdin \
${PLUGIN_REGISTRY:-$ORG_REGISTRY}
2022-06-06 16:46:25 +03:00
fi
docker stack deploy \
$AUTH_FLAGS \
-c "${PLUGIN_COMPOSE_FILE_PATH:-docker-compose.yml}" \
2022-06-07 10:09:15 +03:00
"${PLUGIN_NAME:-$DRONE_REPO_NAME}"
2022-06-06 16:46:25 +03:00