mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
Add NovaCPX to webhook router (VM deploys via its own cron)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,7 @@ $repoMap = [
|
|||||||
'orbis-hosting-portal' => '/home/orbis.orbishosting.com/public_html',
|
'orbis-hosting-portal' => '/home/orbis.orbishosting.com/public_html',
|
||||||
'tomtomgames' => '/home/tomtomgames.com/public_html',
|
'tomtomgames' => '/home/tomtomgames.com/public_html',
|
||||||
'infra' => '/opt/infra',
|
'infra' => '/opt/infra',
|
||||||
|
'novacpx' => '__NOVACPX_VM__',
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!isset($repoMap[$repo])) {
|
if (!isset($repoMap[$repo])) {
|
||||||
@@ -58,6 +59,17 @@ if (!isset($repoMap[$repo])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$path = $repoMap[$repo];
|
$path = $repoMap[$repo];
|
||||||
|
|
||||||
|
// NovaCPX lives on a private VM — the VM polls GitHub every minute via cron
|
||||||
|
// This webhook receipt confirms GitHub delivered the push notification
|
||||||
|
if ($path === '__NOVACPX_VM__') {
|
||||||
|
$commit = $data['after'] ?? 'HEAD';
|
||||||
|
$msg = "[" . date('Y-m-d H:i:s') . "] NovaCPX push by $pusher (commit: $commit) — VM will deploy within 1 min";
|
||||||
|
file_put_contents(DEPLOY_LOG, $msg . "\n", FILE_APPEND | LOCK_EX);
|
||||||
|
echo json_encode(['ok' => true, 'queued' => 'novacpx', 'commit' => $commit]);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
file_put_contents(DEPLOY_QUEUE, $path . "\n", FILE_APPEND | LOCK_EX);
|
file_put_contents(DEPLOY_QUEUE, $path . "\n", FILE_APPEND | LOCK_EX);
|
||||||
|
|
||||||
$msg = "[" . date('Y-m-d H:i:s') . "] Queued deploy: $repo by $pusher -> $path";
|
$msg = "[" . date('Y-m-d H:i:s') . "] Queued deploy: $repo by $pusher -> $path";
|
||||||
|
|||||||
Reference in New Issue
Block a user