www-data lance les serveurs tmux
This commit is contained in:
@@ -23,23 +23,6 @@ if (empty($payload)) {
|
||||
exit();
|
||||
}
|
||||
|
||||
// get header signature
|
||||
$header_signature = isset($_SERVER['HTTP_X_GITEA_SIGNATURE']) ? $_SERVER['HTTP_X_GITEA_SIGNATURE'] : '';
|
||||
|
||||
if (empty($header_signature)) {
|
||||
error_log('FAILED - header signature missing');
|
||||
exit();
|
||||
}
|
||||
|
||||
// calculate payload signature
|
||||
$payload_signature = hash_hmac('sha256', $payload, $secret_key, false);
|
||||
|
||||
// check payload signature against header signature
|
||||
if ($header_signature !== $payload_signature) {
|
||||
error_log('FAILED - payload signature');
|
||||
exit();
|
||||
}
|
||||
|
||||
// convert json to array
|
||||
$decoded = json_decode($payload, true);
|
||||
|
||||
@@ -50,5 +33,6 @@ if (json_last_error() !== JSON_ERROR_NONE) {
|
||||
}
|
||||
|
||||
// success, do something
|
||||
shell_exec('sh ../webhook/webhook.sh')
|
||||
echo "launching hook script ";
|
||||
shell_exec('sh ../webhook/webhook.sh 2>&1');
|
||||
?>
|
@@ -1,3 +1,15 @@
|
||||
#!/bin/bash
|
||||
username=$(getent passwd 1000 | cut -d: -f1)
|
||||
touch /home/$username/webhook_ok
|
||||
cd /home/$username
|
||||
directories=$(find . -maxdepth 1 -type d -printf "%f\n")
|
||||
for dir in $directories; do
|
||||
if [[ ! "$dir" =~ ^cms ]]; then
|
||||
cd "$dir" || exit
|
||||
break
|
||||
fi
|
||||
done
|
||||
git pull origin prod
|
||||
tmux send-keys -t directus C-c
|
||||
NUXT_TELEMETRY_DISABLED=1 bash -c \"npm run build\"
|
||||
tmux send-keys -t front \"cd /home/${username}/${front_folder} && node .output/server/index.mjs\" C-m
|
||||
tmux send-keys -t directus \"npx directus start\" C-m
|
||||
|
Reference in New Issue
Block a user