Change GitHub webhook from building immediately, to queuing builds with task-spooler

This commit is contained in:
Alex Cabal 2020-02-29 22:28:04 -06:00
parent 3669289517
commit d56cb360cc
2 changed files with 4 additions and 4 deletions

View file

@ -11,7 +11,7 @@ cd /standardebooks.org/
git clone https://github.com/standardebooks/web/ git clone https://github.com/standardebooks/web/
# Install Apache, PHP, PHP-FPM, and various other dependencies. # Install Apache, PHP, PHP-FPM, and various other dependencies.
sudo apt install -y composer php-fpm php-cli php-gd php-xml php-apcu php-mbstring php-intl apache2 apache2-utils libfcgi0ldbl sudo apt install -y composer php-fpm php-cli php-gd php-xml php-apcu php-mbstring php-intl apache2 apache2-utils libfcgi0ldbl task-spooler
# Install dependencies using Composer. # Install dependencies using Composer.
cd /standardebooks.org/web/ cd /standardebooks.org/web/

View file

@ -102,13 +102,13 @@ try{
} }
// Our local repo is now updated. Build the ebook! // Our local repo is now updated. Build the ebook!
exec('sudo --set-home --user se-vcs-bot /standardebooks.org/web/scripts/deploy-ebook-to-www ' . escapeshellarg($dir) . ' 2>&1', $output, $returnCode); exec('sudo --set-home --user se-vcs-bot tsp -n /standardebooks.org/web/scripts/deploy-ebook-to-www ' . escapeshellarg($dir) . ' 2>&1', $output, $returnCode);
if($returnCode != 0){ if($returnCode != 0){
Logger::WriteGithubWebhookLogEntry($requestId, 'Error deploying ebook to web. Output: ' . implode("\n", $output)); Logger::WriteGithubWebhookLogEntry($requestId, 'Error queueing ebook for deployment to web. Output: ' . implode("\n", $output));
throw new WebhookException('Couldn\'t process ebook.', $post); throw new WebhookException('Couldn\'t process ebook.', $post);
} }
else{ else{
Logger::WriteGithubWebhookLogEntry($requestId, 'Deploy to web complete.'); Logger::WriteGithubWebhookLogEntry($requestId, 'Queue for deployment to web complete.');
} }
break; break;