12 Commits

Author SHA1 Message Date
Chris Roberts
d08c68ecf3 Adjust how trigger actions are inserted into the stack
This adjusts how triggers are implemented during a normal run. Any
defined triggers which are applicable are located and injected into
the run stack as the stack is built, including hook type triggers.

Support is included for dynamic hook lookup.

The data type used when defining triggers has also been relaxed to
support symbols, strings, or constants.
2020-03-17 15:07:36 -07:00
Brian Cain
fefb702359
Introduce type and command triggers
This commit introduces some basic functionality for typed triggers:

- command
- action

Command triggers are triggers that will run before or after a given
sub-command.

Action triggers are for running triggers before or after internal
actions for Vagrant. This could be before or after a provision step,
before or after synced folders, or networking, etc.
2019-02-01 13:34:15 -08:00
Brian Cain
f4d618eb58
Fixes #9840: Introduce ruby option for trigger
This commit introduces a new option to the core trigger feature: `ruby`.
It can be defined to run ruby code when the trigger is configured to
fire. If you give the ruby block an env and machine argument, the
defined ruby code can use those variables internally.
2018-10-05 12:53:41 -07:00
Brian Cain
58ebd52f99
Add abort option to core triggers
This commit adds a new option `abort`, which when configured, will exit
the Vagrant process completely. If set to `true`, it will exit cleanly
with exit code 0. Otherwise, the exit code can be configured.
2018-09-25 09:40:36 -07:00
Brian Cain
0953287262
Relax only_on rspec tests
only_on can be either a string or regex
2018-04-20 10:51:38 -07:00
Brian Cain
7dae1acd21
Add some "default" options to be validated 2018-04-20 10:51:38 -07:00
Brian Cain
e157362ace
Add run and run_remote expectations 2018-04-20 10:51:38 -07:00
Brian Cain
7b1b044e72
Check for default on_error behavior setting 2018-04-20 10:51:38 -07:00
Brian Cain
6cbb5d8e5d
Add unit tests for config, fix type change bug with map! 2018-04-20 10:51:38 -07:00
Brian Cain
3dec6869bb
Update trigger unit tests 2018-04-20 10:51:38 -07:00
Brian Cain
42419bbd49
Fix rspec tests 2018-04-20 10:51:38 -07:00
Brian Cain
6f00eb5679
Move trigger options into own plugin class 2018-04-20 10:51:38 -07:00