From c7465e780830953bba2d38b65ae27b52cdf002f1 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Fri, 22 Mar 2019 15:01:18 -0500 Subject: [PATCH] Update web hook to become se-vcs-bot when building --- www/webhooks/github.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/webhooks/github.php b/www/webhooks/github.php index 6d779cd1..2931508e 100644 --- a/www/webhooks/github.php +++ b/www/webhooks/github.php @@ -83,7 +83,7 @@ try{ } // Now that we have the ebook filesystem path, pull the latest commit from GitHub. - exec('/standardebooks.org/scripts/pull-from-github ' . escapeshellarg($dir), $output, $returnCode); + exec('sudo -H -u se-vcs-bot /standardebooks.org/scripts/pull-from-github ' . escapeshellarg($dir) . ' 2>&1', $output, $returnCode); if($returnCode != 0){ Logger::WriteGithubWebhookLogEntry($requestId, 'Error pulling from GitHub. Output: ' . implode("\n", $output)); throw new WebhookException('Couldn\'t process ebook.', $post); @@ -93,7 +93,7 @@ try{ } // Our local repo is now updated. Build the ebook! - exec('/standardebooks.org/scripts/deploy-ebook-to-www ' . escapeshellarg($dir), $output, $returnCode); + exec('sudo -H -u se-vcs-bot /standardebooks.org/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)); throw new WebhookException('Couldn\'t process ebook.', $post);