Merge pull request #11090 from briancain/add-note-about-run-bash-scripts

Docs: Add note about running bash with the `run` option for triggers
This commit is contained in:
Brian Cain 2019-10-02 12:46:46 -07:00 committed by GitHub
commit 64cb304153
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -74,6 +74,18 @@ The trigger class takes various options.
+ `inline`
+ `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. For example:
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>"`_.:
```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.
* `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.