deployment-dcdn/assets/webhook.sh

17 lines
569 B
Bash

#!/bin/bash
repo_name=$1
cms_dir=$(ls -d /var/www/repositories/cms*/)
tmux send-keys -t directus C-c
tmux send-keys -t front C-c
cd /var/www/repositories/$repo_name
git pull origin prod
jq '.scripts |= with_entries(.value |= gsub("\\bnuxt \\b"; "./node_modules/nuxt/bin/nuxt.mjs "))' package.json > temp.json && mv temp.json package.json
NUXT_TELEMETRY_DISABLED=1 ; npm install -y
npm run build
tmux send-keys -t front "cd /var/www/repositories/${repo_name} && node .output/server/index.mjs" C-m
tmux send-keys -t directus "cd ${cms_dir} && npx directus start" C-m