Files
videoreg.ru/deploy/deploy-static.sh
huncode 53e4f06486
Production container deploy / production (push) Failing after 2m34s
Restore videoreg public guide site with static isolated deployment
2026-10-26 14:26:13 +03:00

11 lines
696 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
: "${IMAGE:?Provide immutable registry image tag or digest}"
DEPLOY_HOST="${DEPLOY_HOST:-zz}"
REMOTE_RELEASE="/tmp/videoreg-static-deploy"
ssh -o BatchMode=yes "$DEPLOY_HOST" "mkdir -p '$REMOTE_RELEASE'"
scp -o BatchMode=yes deploy/stack.yml "$DEPLOY_HOST:$REMOTE_RELEASE/stack.yml"
# IMAGE is validated to avoid injecting shell commands in the remote environment.
[[ "$IMAGE" =~ ^[a-zA-Z0-9._/:@-]+$ ]] || exit 2
ssh -o BatchMode=yes "$DEPLOY_HOST" "cd '$REMOTE_RELEASE' && IMAGE='$IMAGE' DOMAIN=videoreg.ru STACK_NAME=videoreg TRAEFIK_NETWORK=traefik-public docker stack deploy --with-registry-auth -c stack.yml videoreg && docker stack services videoreg"