logging du webhook
This commit is contained in:
parent
f192e4bcbe
commit
da2617d9e4
|
@ -35,5 +35,5 @@ if (json_last_error() !== JSON_ERROR_NONE) {
|
||||||
// success, do something
|
// success, do something
|
||||||
$repo_name = $decoded['repository']['name'];
|
$repo_name = $decoded['repository']['name'];
|
||||||
echo "launching hook script ";
|
echo "launching hook script ";
|
||||||
echo shell_exec('bash ../webhook/webhook.sh ' . $repo_name . ' 2>&1');
|
echo shell_exec('bash ../webhook/webhook.sh ' . $repo_name . ' >> ../webhook/webhook.log 2>&1');
|
||||||
?>
|
?>
|
|
@ -1,12 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
repo_name=$1
|
repo_name=$1
|
||||||
cd /var/www/repositories/$repo_name
|
|
||||||
git pull origin prod
|
|
||||||
tmux send-keys -t directus C-c
|
|
||||||
npm install -y
|
|
||||||
npx nuxt telemetry disable
|
|
||||||
npm run build
|
|
||||||
tmux send-keys -t front C-c
|
|
||||||
tmux send-keys -t front "cd /var/www/repositories/${repo_name} && node .output/server/index.mjs" C-m
|
|
||||||
cms_dir=$(ls -d /var/www/repositories/cms*/)
|
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 &&\
|
||||||
|
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
|
tmux send-keys -t directus "cd ${cms_dir} && npx directus start" C-m
|
|
@ -399,6 +399,8 @@ if [[ "$answer" == "y" ]]; then
|
||||||
cp ./assets/webhook.sh /var/www/webhook
|
cp ./assets/webhook.sh /var/www/webhook
|
||||||
chown www-data:www-data /var/www/webhook/webhook.sh
|
chown www-data:www-data /var/www/webhook/webhook.sh
|
||||||
chmod u+x /var/www/webhook/webhook.sh
|
chmod u+x /var/www/webhook/webhook.sh
|
||||||
|
touch /var/www/webhook/webhook.log
|
||||||
|
chown www-data:www-data /var/www/webhook/webhook.log
|
||||||
|
|
||||||
head -n $(($(wc -l < $caddyfile) - 2)) $caddyfile > temp_Caddyfile && mv temp_Caddyfile $caddyfile
|
head -n $(($(wc -l < $caddyfile) - 2)) $caddyfile > temp_Caddyfile && mv temp_Caddyfile $caddyfile
|
||||||
echo "handle /webhook.php {" >> $caddyfile
|
echo "handle /webhook.php {" >> $caddyfile
|
||||||
|
|
Loading…
Reference in New Issue