From d56cb360cc91c724087fec70d5b4116f32e5ba30 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Sat, 29 Feb 2020 22:28:04 -0600 Subject: [PATCH] Change GitHub webhook from building immediately, to queuing builds with task-spooler --- README.md | 2 +- www/webhooks/github.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 535aa2bb..e8bbf552 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ cd /standardebooks.org/ git clone https://github.com/standardebooks/web/ # 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. cd /standardebooks.org/web/ diff --git a/www/webhooks/github.php b/www/webhooks/github.php index bf2f1caf..35290f89 100644 --- a/www/webhooks/github.php +++ b/www/webhooks/github.php @@ -102,13 +102,13 @@ try{ } // 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){ - 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); } else{ - Logger::WriteGithubWebhookLogEntry($requestId, 'Deploy to web complete.'); + Logger::WriteGithubWebhookLogEntry($requestId, 'Queue for deployment to web complete.'); } break;