push db changes to git
Deploy / Deploy (push) Successful in 10s Details

This commit is contained in:
Carneiro 2024-12-19 19:55:44 -03:00
parent 9b7275585f
commit 65d1289067
1 changed files with 7 additions and 3 deletions

View File

@ -43,7 +43,7 @@
// Processa o vídeo com o script do flavio
function process_file($username, $title, $input_file, $output_file) {
$SCRIPT_PATH = '/var/www/src/aliceclass/script/script.sh';
$SCRIPT_PATH = '/var/www/html/aliceclass/script/script.sh';
$cmd = sprintf('%s "%s" "%s" "%s" "%s" "%s"',
$SCRIPT_PATH, $title, $username, $input_file, '', $output_file);
@ -74,8 +74,10 @@
}
function push_to_git() {
// $git_cmd = '-c user.name="www-data" -c user.email="no-replay@example.org"'
// shell_exec('cd /var/www/src/AliceClass;' . $git_cmd . 'add _data/aulas.json;' . $git_cmd . 'commit -m "update data";' . $git_cmd . 'push');
$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');
}
$username = $_SERVER['PHP_AUTH_USER'];
@ -97,6 +99,8 @@
upload($orig_file, $brute_file); //|| echo error && exit;
process_file($username, $video_title, $brute_file, $target_file); // || echo error && exit;
insert_into_db($username, $video_title, $video_desc, $video_level, $video_software, $video_date);
push_to_git();
echo "The file ". htmlspecialchars(basename($orig_file)). " has been uploaded.";
?>