From 7d231984d10d22972f02b039d117a85638d30a46 Mon Sep 17 00:00:00 2001 From: Patrick Schoo Date: Mon, 24 Feb 2025 10:40:39 +0100 Subject: [PATCH 1/2] Add wait option to run-task command for cf7 and cf8 --- resource/commands/run-task.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resource/commands/run-task.sh b/resource/commands/run-task.sh index fa99f7b..d121639 100644 --- a/resource/commands/run-task.sh +++ b/resource/commands/run-task.sh @@ -4,6 +4,7 @@ task_command=$(get_option '.task_command') task_name=$(get_option '.task_name') memory=$(get_option '.memory') disk_quota=$(get_option '.disk_quota') +wait=$(get_option '.wait') logger::info "Executing #magenta(%s) on app #yellow(%s)" "$command" "$app_name" @@ -21,4 +22,8 @@ fi [ -n "$memory" ] && args+=(-m "$memory") [ -n "$disk_quota" ] && args+=(-k "$disk_quota") +if ! cf::is_cf6 && [ "true" = "$wait" ]; then + args+=(--wait) +fi + cf::cf run-task "${args[@]}" From f9bbb11b5114c0aba8b2f9c79024799962e1043f Mon Sep 17 00:00:00 2001 From: Patrick Schoo Date: Tue, 25 Feb 2025 10:17:36 +0100 Subject: [PATCH 2/2] Update documentation --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e9a8a6e..4f5593d 100644 --- a/README.md +++ b/README.md @@ -1300,6 +1300,7 @@ Run a one-off task on an app | `task_name` | *Optional* | All | Name to give the task (generated if omitted) | `memory` | *Optional* | All | Memory limit (e.g. 256M, 1024M, 1G) | `disk_quota` | *Optional* | All | Disk limit (e.g. 256M, 1024M, 1G) +| `wait` | *Optional* | 7, 8 | Wait for the operation to complete ```yaml - put: cloud-foundry @@ -1358,4 +1359,4 @@ Disallow space ssh in the targeted space params: command: disallow-space-ssh space: myspace -``` \ No newline at end of file +```