From a54d18a4444abfb081d3b2af2e06738d2a9f19ad Mon Sep 17 00:00:00 2001 From: Torben Klepsch Date: Thu, 3 May 2018 12:44:17 +0200 Subject: [PATCH 1/3] Added option cleanup_tty to allow allocation when using sudo --- recipe/deploy/cleanup.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipe/deploy/cleanup.php b/recipe/deploy/cleanup.php index e05306604..08b63b881 100644 --- a/recipe/deploy/cleanup.php +++ b/recipe/deploy/cleanup.php @@ -12,6 +12,10 @@ $releases = get('releases_list'); $keep = get('keep_releases'); $sudo = get('cleanup_use_sudo') ? 'sudo' : ''; + $runOpts = []; + if ($sudo) { + $runOpts['tty'] = get('cleanup_tty', false); + } if ($keep === -1) { // Keep unlimited releases. @@ -24,7 +28,7 @@ } foreach ($releases as $release) { - run("$sudo rm -rf {{deploy_path}}/releases/$release"); + run("$sudo rm -rf {{deploy_path}}/releases/$release", $runOpts); } run("cd {{deploy_path}} && if [ -e release ]; then $sudo rm release; fi"); From 0bdd6cdb5abc87e929cba56523b665b841c0eddc Mon Sep 17 00:00:00 2001 From: Torben Klepsch Date: Thu, 3 May 2018 12:47:40 +0200 Subject: [PATCH 2/3] Added comment for new option cleanup_tty to CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e82f4b33b..be37f96e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Added cache clear/warmup task for symfony4 recipe [#1575] - Added ability to use config params in host variables [#1508] - Make used shell configurable via `shellCommand` [#1536] +- Added `cleanup_tty` option for `deploy:cleanup` ### Fixed - Fixed that long http user name is not detected correctly [#1580] From c166c58bfbf41166dd4972babddc8be42514f5e7 Mon Sep 17 00:00:00 2001 From: Torben Klepsch Date: Thu, 14 Jun 2018 15:27:07 +0200 Subject: [PATCH 3/3] Added cleanup_use_sudo option to all commands in cleanup.php --- recipe/deploy/cleanup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/deploy/cleanup.php b/recipe/deploy/cleanup.php index 08b63b881..a11121759 100644 --- a/recipe/deploy/cleanup.php +++ b/recipe/deploy/cleanup.php @@ -31,6 +31,6 @@ run("$sudo rm -rf {{deploy_path}}/releases/$release", $runOpts); } - run("cd {{deploy_path}} && if [ -e release ]; then $sudo rm release; fi"); - run("cd {{deploy_path}} && if [ -h release ]; then $sudo rm release; fi"); + run("cd {{deploy_path}} && if [ -e release ]; then $sudo rm release; fi", $runOpts); + run("cd {{deploy_path}} && if [ -h release ]; then $sudo rm release; fi", $runOpts); });