forked from bchanot/claude
feat(skills): /deploy NEXT.sh session style + inline hand-back print
First-real-run UX feedback (EVAL-016): one command per line as typed in an interactive session (ssh opens the box, following lines run on it, local steps flagged), never folded ssh compounds; the hand-back prints the full checklist in the conversation (and every re-hand-back reprints it). Step defined as a block (header + command lines to next blank line), @delta governs the block. Template restyled to match.
This commit is contained in:
@@ -4,22 +4,31 @@
|
||||
# @config push_deploy_tags=false
|
||||
# NOTE grammar: glob=<pat>:each repeats the command per matching file (e.g. psql -f <each>);
|
||||
# glob=<pat>:list runs once + lists matching files as VERIFY items; when=<pat,...> is conditional.
|
||||
# Style: one command per line, as typed in an interactive session — step 1 opens
|
||||
# the ssh session, later steps run ON the box; local steps say "(from your machine)".
|
||||
|
||||
# 1) backup BEFORE any forward-only migration
|
||||
ssh "$DEPLOY_HOST" 'pg_dump "$DB" > ~/backups/pre-deploy-$(date +%F-%H%M).sql' # VERIFY: dump size > 0
|
||||
# 1) connect + pull the desired branch (fixed)
|
||||
ssh "$DEPLOY_HOST"
|
||||
cd "$APP_DIR"
|
||||
git pull # VERIFY: HEAD == target sha
|
||||
|
||||
# 2) backup BEFORE any forward-only migration
|
||||
pg_dump "$DB" > ~/backups/pre-deploy-$(date +%F-%H%M).sql # VERIFY: dump size > 0
|
||||
|
||||
# @delta:migrations glob=supabase/migrations/*.sql:list
|
||||
# 2) apply NEW migrations (one command; skill lists the delta migrations to VERIFY)
|
||||
ssh "$DEPLOY_HOST" 'supabase migration up' # VERIFY: "Applied" for each
|
||||
# 3) apply NEW migrations (one command; the skill lists the delta migrations to VERIFY)
|
||||
supabase migration up # VERIFY: "Applied" for each
|
||||
|
||||
# @delta:rebuild when=docker-compose*.yml,Dockerfile,Dockerfile.*
|
||||
# 3) rebuild + restart services (only if build inputs changed)
|
||||
ssh "$DEPLOY_HOST" 'docker compose up -d --build' # VERIFY: docker compose ps healthy
|
||||
# 4) rebuild + restart services (only if build inputs changed)
|
||||
docker compose up -d --build # VERIFY: docker compose ps healthy
|
||||
|
||||
# @delta:deps when=package.json,*lock*,requirements.txt,pyproject.toml
|
||||
# 4) install deps (only if manifests changed)
|
||||
ssh "$DEPLOY_HOST" 'cd app && npm ci' # VERIFY: exit 0
|
||||
# 5) install deps (only if manifests changed)
|
||||
cd app
|
||||
npm ci # VERIFY: exit 0
|
||||
|
||||
# 5) reload cache + smoke test (fixed)
|
||||
ssh "$DEPLOY_HOST" 'systemctl reload app'
|
||||
curl -fsS https://$DEPLOY_HOST/health # VERIFY: HTTP 200
|
||||
# 6) reload + smoke test
|
||||
systemctl reload app
|
||||
# (from your machine)
|
||||
curl -fsS https://$DEPLOY_HOST/health # VERIFY: HTTP 200
|
||||
|
||||
Reference in New Issue
Block a user