cvx
This commit is contained in:
parent
2eb1e2bb80
commit
042d90cf7f
2 changed files with 51 additions and 1 deletions
50
swarm/stack/Gremlin/deploy.sh
Normal file
50
swarm/stack/Gremlin/deploy.sh
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# =============================================================================
|
||||||
|
# Gremlin Stack — Deploy Script
|
||||||
|
# Usage: ./deploy.sh
|
||||||
|
# Run from: services/swarm/stack/Gremlin/
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
STACK_NAME="gremlin"
|
||||||
|
COMPOSE_FILE="gremlin-stack.yml"
|
||||||
|
ENV_FILE=".env"
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
|
cd "$SCRIPT_DIR"
|
||||||
|
|
||||||
|
if [ ! -f "$ENV_FILE" ]; then
|
||||||
|
echo "ERROR: $ENV_FILE not found in $SCRIPT_DIR"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$COMPOSE_FILE" ]; then
|
||||||
|
echo "ERROR: $COMPOSE_FILE not found in $SCRIPT_DIR"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
RESOLVED_FILE="${COMPOSE_FILE%.yml}.resolved.yml"
|
||||||
|
|
||||||
|
# Load env vars into shell so docker stack config can resolve them
|
||||||
|
echo "Loading environment from $ENV_FILE..."
|
||||||
|
set -a
|
||||||
|
source "$ENV_FILE"
|
||||||
|
set +a
|
||||||
|
|
||||||
|
# Preprocess — resolves all ${VAR} substitutions natively
|
||||||
|
echo "Preprocessing stack file..."
|
||||||
|
docker stack config --compose-file "$COMPOSE_FILE" > "$RESOLVED_FILE"
|
||||||
|
|
||||||
|
# Deploy from the resolved file
|
||||||
|
echo "Deploying stack: $STACK_NAME"
|
||||||
|
docker stack deploy --compose-file "$RESOLVED_FILE" "$STACK_NAME"
|
||||||
|
|
||||||
|
# Remove resolved file — contains plaintext secrets
|
||||||
|
rm -f "$RESOLVED_FILE"
|
||||||
|
echo "Cleaned up resolved file."
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Deploy complete. Checking services..."
|
||||||
|
sleep 3
|
||||||
|
docker stack services "$STACK_NAME"
|
||||||
|
|
@ -116,7 +116,7 @@ services:
|
||||||
- kuma.n8n.http.name=n8n
|
- kuma.n8n.http.name=n8n
|
||||||
- kuma.n8n.http.url=http://n8n:5678
|
- kuma.n8n.http.url=http://n8n:5678
|
||||||
- caddy=n8n.netgrimoire.com
|
- caddy=n8n.netgrimoire.com
|
||||||
- caddy.reverse_proxy={{upstreams 5678}}
|
- caddy.reverse_proxy="n8n:5678"
|
||||||
placement:
|
placement:
|
||||||
constraints:
|
constraints:
|
||||||
- node.hostname == docker4
|
- node.hostname == docker4
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue