тест 4 обработчика гитлаба

This commit is contained in:
Dmitry Karpukhin 2026-01-16 11:40:58 +08:00
parent f72849f55f
commit d51dbc3c45

View File

@ -12,7 +12,7 @@
if ($hash !== $signature) if ($hash !== $signature)
{ {
error_log('FAILED - payload signature mismatch'); error_log('FAILED - payload signature mismatch');
exit(); exit("wrong signature");
} }
$json = json_decode($payload, true); $json = json_decode($payload, true);
@ -21,11 +21,13 @@
if (json_last_error() !== JSON_ERROR_NONE) if (json_last_error() !== JSON_ERROR_NONE)
{ {
error_log('FAILED - json decode - '. json_last_error()); error_log('FAILED - json decode - '. json_last_error());
exit(); exit(json_last_error());
} }
if(strcmp($json['object_kind'], 'push') == 0) if(strcmp($json['object_kind'], 'push') == 0)
{ {
$result = shell_exec("cd /var/www/lk && git reset --hard HEAD && git pull"); $result = shell_exec("cd /var/www/lk && git reset --hard HEAD && git pull");
file_put_contents("/var/www/lk/storage/logs/temp_exec", print_r($result, 1)); file_put_contents("/var/www/lk/storage/logs/temp_exec", print_r($result, 1));
echo "<p>$result</p>";
} }