#!/usr/bin/env bash # Scaffold a new ISOLATED client stack from _template/. # # Usage: ./new-client.sh [source-site-dir] # ./new-client.sh happynails happynails.de ../../templates/landing/preview-happynails # # Creates deploy/clients// with its own .env + site/, then prints the # Caddy block and the deploy command. Run it from deploy/clients/. set -euo pipefail cd "$(dirname "$0")" SLUG="${1:?usage: new-client.sh [source-site-dir]}" DOMAIN="${2:?domain required (e.g. happynails.de)}" SRC="${3:-}" [[ "$SLUG" =~ ^[a-z0-9-]+$ ]] || { echo "slug must be lowercase letters/digits/dashes"; exit 1; } [ -e "$SLUG" ] && { echo "client '$SLUG' already exists at deploy/clients/$SLUG"; exit 1; } cp -r _template "$SLUG" cat > "$SLUG/.env" < 188.193.49.3. 3) Deploy the stack: scp -r $SLUG mivanchenko@mivanchenko.de:/home/mivanchenko/clients/ ssh mivanchenko@mivanchenko.de 'cd ~/clients/$SLUG && docker compose up -d' Remove this client later (isolated — touches nothing else): ssh mivanchenko@mivanchenko.de 'cd ~/clients/$SLUG && docker compose down' EOF