mirror of
https://git.meshkee.com/Meshkee/backend.git
synced 2026-08-11 22:30:59 +04:30
Enable storefront provision from Add Domain via optional git URL.
Persist deploy_slug on domains, call the websites agent /provision endpoint, and drop the hard-coded host map so Deploy appears from the UI. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
9ca6e2306f
commit
d933aef40b
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SLUG="${1:-}"
|
||||
if [[ -z "$SLUG" ]]; then
|
||||
echo "usage: deploy.sh <slug>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ROOT="/var/www/sites/$SLUG"
|
||||
LOG="/var/log/websites/deploy-$SLUG.log"
|
||||
exec >>"$LOG" 2>&1
|
||||
|
||||
echo "==== $(date -u +%Y-%m-%dT%H:%M:%SZ) deploy start: $SLUG ===="
|
||||
|
||||
if [[ ! -d "$ROOT/.git" ]]; then
|
||||
echo "missing site: $ROOT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "$ROOT"
|
||||
git fetch origin
|
||||
git reset --hard origin/main
|
||||
npm ci
|
||||
npm run build
|
||||
pm2 restart "$SLUG" --update-env || pm2 start /var/www/sites/ecosystem.config.cjs --only "$SLUG"
|
||||
echo "==== $(date -u +%Y-%m-%dT%H:%M:%SZ) deploy ok: $SLUG ===="
|
||||
Reference in New Issue
Block a user