Docs: Add note about running bash with the `run` option for triggers

This commit is contained in:
Brian Cain 2019-09-26 12:54:53 -07:00
parent b3462d805b
commit f69bdc4bb6
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
1 changed files with 12 additions and 0 deletions

View File

@ -74,6 +74,18 @@ The trigger class takes various options.
+ `inline` + `inline`
+ `path` + `path`
**Note:** The `run` option with `inline` is not entirely like a shell provisioner that runs bash.
It executes binaries on your machine rather than a bash script. If you wish you use
bash to pipe some text to a file in your `run` option with `inline`, wrap
your inline script with _`bash -c "<script goes here>"`_. For example:
```ruby
config.trigger.after :up do |trigger|
trigger.info = "More information"
trigger.run = {inline: "bash -c 'echo \"hey there!!\" > file.txt'"}
end
```
* `warn` (string) - A warning message that will be printed at the beginning of a trigger. * `warn` (string) - A warning message that will be printed at the beginning of a trigger.
* `exit_codes` (integer, array) - A set of acceptable exit codes to continue on. Defaults to `0` if option is absent. For now only valid with the `run` option. * `exit_codes` (integer, array) - A set of acceptable exit codes to continue on. Defaults to `0` if option is absent. For now only valid with the `run` option.