From 52b5eb89de02ac1c31b3f56440b011cb9001fd98 Mon Sep 17 00:00:00 2001 From: Javier Blanco Date: Thu, 30 Apr 2026 11:29:27 +0700 Subject: [PATCH] clean 2 --- deploy.php | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 2 +- 2 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 deploy.php diff --git a/deploy.php b/deploy.php new file mode 100644 index 0000000..20cd84d --- /dev/null +++ b/deploy.php @@ -0,0 +1,128 @@ +&1', + 'cd ' . escapeshellarg(REPO_PATH) . ' && ' . GIT_BIN . ' checkout ' . escapeshellarg(ALLOWED_BRANCH) . ' 2>&1', + 'cd ' . escapeshellarg(REPO_PATH) . ' && ' . GIT_BIN . ' pull origin ' . escapeshellarg(ALLOWED_BRANCH) . ' 2>&1', +]; + +$outputAll = []; +$returnCode = 0; + +foreach ($commands as $cmd) { + $output = []; + $cmdReturn = 0; + exec($cmd, $output, $cmdReturn); + + $outputAll[] = '$ ' . $cmd; + $outputAll[] = implode("\n", $output); + $outputAll[] = 'exit_code=' . $cmdReturn; + + if ($cmdReturn !== 0) { + $returnCode = $cmdReturn; + break; + } +} + +log_line("PROJECT_KEY=" . PROJECT_KEY . "\n" . implode("\n", $outputAll) . "\n---"); + +if ($returnCode !== 0) { + respond(500, 'Deploy failed. Revisa deploy.log'); +} + +respond(200, 'Deploy OK'); \ No newline at end of file diff --git a/index.html b/index.html index ad3ea74..9eb540e 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,6 @@ Hola mundo -

Hola mundo 10

+

Hola mundo 11

\ No newline at end of file