deployment-dcdn/assets/webhook.sh

17 lines
569 B
Bash
Raw Normal View History

2024-02-25 19:17:44 +01:00
#!/bin/bash
2024-02-26 12:34:20 +01:00
repo_name=$1
2024-02-27 16:57:10 +01:00
cms_dir=$(ls -d /var/www/repositories/cms*/)
2024-04-16 16:03:33 +02:00
tmux send-keys -t directus C-c
2024-02-26 18:00:57 +01:00
tmux send-keys -t front C-c
2024-04-16 16:03:33 +02:00
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
2024-02-27 13:16:17 +01:00
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