Update php/upload.php
Deploy / Deploy (push) Successful in 12s Details

This commit is contained in:
Carneiro 2025-01-22 16:38:44 -03:00
parent 9170334fe4
commit 7eddb2b5f0
1 changed files with 8 additions and 4 deletions

View File

@ -76,10 +76,14 @@
}
function push_to_git() {
$git_cmd = 'git --git-dir=/var/www/src/aliceclass';
shell_exec($git_cmd . ' add /var/www/src/aliceclass/_data/aulas.json');
shell_exec($git_cmd . ' commit -m "update data"');
shell_exec($git_cmd . ' push');
$git_cmd = 'cd /var/www/src/aliceclass; git ';
shell_exec($git_cmd . ' config user.name www-data 2>&1');
shell_exec($git_cmd . ' config user.email www-data@noreply.alice 2>&1');
shell_exec($git_cmd . ' add /var/www/src/aliceclass/_data/aulas.json 2>&1');
shell_exec($git_cmd . ' commit -m "update data" 2>&1');
shell_exec($git_cmd . ' push 2>&1');
}
$username = $_SERVER['PHP_AUTH_USER'];