From 35f7908b1fb7e405241ef2395a84e0cc31bc49df Mon Sep 17 00:00:00 2001 From: Oliver Stark Date: Mon, 7 Feb 2022 13:58:17 +0100 Subject: [PATCH] Increased timeout (300s) for custom deploy scripts --- CHANGELOG.md | 3 +++ src/Helpers/DeployHooksHelper.php | 2 ++ src/Plugin.php | 2 ++ 3 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 524eb74..10f1713 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.1.1 - 2022-02-07 +- Increased timeout (300s) for before/after deploy scripts eventually + ## 1.1.0 - 2022-01-18 - Added support for Craft Nitro [see README.md](https://github.com/fortrabbit/craft-copy#craft-nitro-support) - Dropped PHP 7.2 support diff --git a/src/Helpers/DeployHooksHelper.php b/src/Helpers/DeployHooksHelper.php index b889cda..7815816 100644 --- a/src/Helpers/DeployHooksHelper.php +++ b/src/Helpers/DeployHooksHelper.php @@ -4,6 +4,7 @@ namespace fortrabbit\Copy\Helpers; +use fortrabbit\Copy\Plugin; use Symfony\Component\Process\Process; trait DeployHooksHelper @@ -45,6 +46,7 @@ protected function runDeployCommands(string $when): bool foreach ($scripts as $script) { $this->cmdBlock($script); $process = Process::fromShellCommandline($script); + $process->setTimeout(Plugin::DEPLOY_HOOK_TIMEOUT); $process->run(); if (! $process->isSuccessful()) { $this->errorBlock($process->getErrorOutput()); diff --git a/src/Plugin.php b/src/Plugin.php index 75784f5..0a36adb 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -48,6 +48,8 @@ class Plugin extends BasePlugin { public const DASHBOARD_URL = 'https://dashboard.fortrabbit.com'; + public const DEPLOY_HOOK_TIMEOUT = 300; + public const ENV_DEFAULT_STAGE = 'DEFAULT_STAGE'; public const PLUGIN_ROOT_PATH = __DIR__;