From 8c9342daac446702d70d272cc81c1adb6cd3ae39 Mon Sep 17 00:00:00 2001 From: Dekart Deploy Bot Date: Thu, 7 May 2026 17:33:16 +0300 Subject: [PATCH] Admin test: git push from WordPress --- test-git-push.php | 34 ++++++++++++++++++++++++++ wp-content/themes/dekart/functions.php | 1 + 2 files changed, 35 insertions(+) create mode 100644 test-git-push.php diff --git a/test-git-push.php b/test-git-push.php new file mode 100644 index 0000000..a35f031 --- /dev/null +++ b/test-git-push.php @@ -0,0 +1,34 @@ +Git Push Diagnostic - Step by Step"; + +// Шаг 1: git add +echo "

Step 1: git add .

"; +exec('cd ' . escapeshellarg(__DIR__) . ' && git add . 2>&1', $add_out, $add_code); +echo "Return code: $add_code
"; +echo "Output:
" . (empty($add_out) ? '(empty)' : implode("\n", $add_out)) . "
"; + +// Шаг 2: git commit +echo "

Step 2: git commit

"; +exec('cd ' . escapeshellarg(__DIR__) . ' && git commit -m "Test from web process" 2>&1', $commit_out, $commit_code); +echo "Return code: $commit_code
"; +echo "Output:
" . (empty($commit_out) ? '(empty)' : implode("\n", $commit_out)) . "
"; + +// Шаг 3: git push (только если commit успешен) +if ($commit_code === 0) { + echo "

Step 3: git push

"; + exec('cd ' . escapeshellarg(__DIR__) . ' && git push 2>&1', $push_out, $push_code); + echo "Return code: $push_code
"; + echo "Output:
" . (empty($push_out) ? '(empty)' : implode("\n", $push_out)) . "
"; +} else { + echo "

Step 3: Skipped (commit failed)

"; +} + +// Дополнительная информация +echo "

Debug Info

"; +echo "Current user: " . posix_getpwuid(posix_geteuid())['name'] . "
"; +echo "Git config sshCommand: "; +exec('cd ' . escapeshellarg(__DIR__) . ' && git config --get core.sshCommand 2>&1', $ssh_cmd); +echo "
" . (empty($ssh_cmd) ? '(not set)' : implode("\n", $ssh_cmd)) . "
"; +?> diff --git a/wp-content/themes/dekart/functions.php b/wp-content/themes/dekart/functions.php index b07c242..382cee0 100644 --- a/wp-content/themes/dekart/functions.php +++ b/wp-content/themes/dekart/functions.php @@ -896,3 +896,4 @@ function dekart_add_preload_hints() { add_action('wp_head', 'dekart_add_preload_hints', 1);// Тестовая строка для проверки деплоя 2026-05-06 // Test comment Thu May 7 17:21:53 MSK 2026 // Test Thu May 7 17:27:22 MSK 2026 +// Admin test Thu May 7 17:27:51 MSK 2026