38516-vm/deploy_commands.php
2026-02-17 14:31:54 +00:00

18 lines
418 B
PHP

<?php
declare(strict_types=1);
// Run the deploy command
$output = [];
$return_var = 0;
exec("node deploy.js 2>&1", $output, $return_var);
$log = implode("\n", $output);
file_put_contents('bot.log', "[Deploy] " . date('Y-m-d H:i:s') . "\n" . $log . "\n\n", FILE_APPEND);
if ($return_var === 0) {
header("Location: index.php?deploy_success=1");
} else {
header("Location: index.php?deploy_error=1");
}
exit;