Dmitriy Pleshevskiy
4c632b99f8
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
27 lines
525 B
Bash
27 lines
525 B
Bash
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
registry="${PLUGIN_REGISTRY:-$ORG_REGISTRY}"
|
|
stack_name="${PLUGIN_NAME:-${DRONE_REPO_NAME:-${CI_REPO_NAME}}}"
|
|
compose_file="${PLUGIN_COMPOSE_FILE_PATH:-docker-compose.yml}"
|
|
|
|
set -x
|
|
|
|
if [ -n "${registry}" ]; then
|
|
auth_flags=--with-registry-auth
|
|
fi
|
|
|
|
if [ -n "$PLUGIN_PASSWORD" ]; then
|
|
echo -n "$PLUGIN_PASSWORD" | \
|
|
docker login \
|
|
-u "$PLUGIN_USERNAME" \
|
|
--password-stdin \
|
|
${registry}
|
|
fi
|
|
|
|
docker stack deploy
|
|
$auth_flags \
|
|
--compose-file "${compose_file}" \
|
|
"${stack_name}"
|
|
|