Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1358,4 +1359,4 @@ Disallow space ssh in the targeted space
params:
command: disallow-space-ssh
space: myspace
```
```
5 changes: 5 additions & 0 deletions resource/commands/run-task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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[@]}"