Add group to callback template

This commit is contained in:
Arne Beer 2020-05-11 14:02:08 +02:00
parent 315a28d21a
commit 28e8b6d7b2
2 changed files with 6 additions and 0 deletions

View file

@ -242,6 +242,7 @@ These are the available variables that can be used to create a command:
- `{{ command }}`
- `{{ path }}`
- `{{ result }}` (Success, Killed, etc.)
- `{{ group }}`
Example callback:
```

View file

@ -670,6 +670,11 @@ impl TaskHandler {
parameters.insert("command", task.command.clone());
parameters.insert("path", task.path.clone());
parameters.insert("result", task.result.clone().unwrap().to_string());
if let Some(group) = &task.group {
parameters.insert("group", group.clone());
} else {
parameters.insert("group", "default".into());
}
let callback_command = match handlebars.render_template(&callback, &parameters) {
Ok(command) => command,
Err(err) => {