21 lines
429 B
Bash
21 lines
429 B
Bash
#!/bin/sh
|
|
|
|
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}
|
|
fi
|
|
|
|
docker stack deploy \
|
|
$AUTH_FLAGS \
|
|
-c "${PLUGIN_COMPOSE_FILE_PATH:-docker-compose.yml}" \
|
|
"${PLUGIN_NAME:-$DRONE_REPO_NAME}"
|
|
|