- No Hosts file created
Call
Invoke-BundleCommand -Name beaker -... <list of beaker vars to override>
The following should happen.- If no hypervisor and string are specified then the default hypervisor and string are chosen to generate an ephemeral hosts file at the location specified in the
BEAKER_setfile
location. - Env vars are set for the run.
- A quick parse of the hosts file should be done to determine if this is a master/agent run or agent only and set env vars to match.
- Ensure we are at the top level of the git repo
- bundle install with defaults for
--path
and allow passing values to--without
if these tasks have not already been accomplished. An override may exist to wipe and re-install on any given run. bundle exec rake spec_prep
if this has not already been done.- Bundle command is invoked. The string passed to
Command
is appended tobundle exec
and run. - When tasks are complete
- Remove all env vars that were set
- If an autogenerated hosts file was used, delete it.
- A hosts file should only have been generated if a hosts file did not already exists at the
BEAKER_setfile
location. An option should exist to auto generate the hosts file but not delete it.
- A hosts file should only have been generated if a hosts file did not already exists at the
- If no hypervisor and string are specified then the default hypervisor and string are chosen to generate an ephemeral hosts file at the location specified in the
- Setting
BEAKER_PUPPET_AGENT_VERSION
to anything at all can cause some tests to fail. The usual setting of something in the 5 series causes an invalid url for older helpers. Simply omitting the var causes it to default tolatest
for the older series. Need to look at implementing a method to remove variables from the array of vars to set, both on the cmdline and by default in the conf file.
- Invoke-BundleCommand
- Parameters
- All defined named testing parameters
UserDefined
Takes a hash table of custom parameters to set and then remove.Hypervisor
Helps to find the correct hosts string from the config.json file. Used in conjunction with the next parameter.HostsString
Take the name of defined hosts string in the json config file, or a raw host string to pass tobeaker-hostgenerator
OverrideSet
Take the name of an override set. These are named sets of individual variables that can override the default global values. These can be used to create named sets of parameters named after a module for instance, that can override single sets of values.Command
This is the command to put afterbundle exec
and invoke on the command line. For exampleInvoke-BundleCommand -Command 'rake beaker'
will result inInvoke-Expression -Command 'bundle exec rake beaker'
.OverwriteHosts
A switch parameter that will tell the cmdlet whether to overwrite a hosts file if it finds one already in place at theBEAKER_setfile
location. If this parameter is ommitted then the hosts file it finds is used. This allows the user to manually tweak a hosts file and move those settings into the defined strings in the config file if needed, without the module constantly overwriting it.BundlePath
Override the default bundle path of .\bundle\gemsVerbose
- Notes
- Either or both of the
Hypervisor
andHostsString
parameters can be omitted, and the default set in the config file will be used. - A user can pass a raw beaker-hostgenerator hosts string to
HostsString
and use that instead. If the value passed toHostsString
does not match the name of a defined string from the config file, it is passed verbatim to beaker-hostgenerator.
- Either or both of the
- Parameters
- Set-BeakerEnvVar
- Parameters
- ALl Defined named testing parameters
UserDefined
Takes a hash table of custom parameters to set.Verbose
- Notes
- This cmdlet will call the host generator after the env vars are set, because those vars often affect the output of the host generator.
- Will call another cmdlet after the set file is generated to decide if any of the vars need to change based on whether the set file has a master defined or not.
- The name of the cmdlet is singular to comply with the powershell naming convention, but the default behaviour sets many variables. I'm not sure how to reconsile the name and the behavior.
- Parameters
- Remove-BeakerEnvVar
- Parameters
UserDefined
Takes a hash table of custom parameters to remove. Most of the time you should simply assign this as a hash variable and then pass the same variable to both the set and remove cmdlets to ensure they are all removed. If this parameter is passed intoInvoke-BundleCommand
then that is exactly what will happen in thebegin{}
andend{}
blocks.Verbose
- Parameters
- New-Setfile
- Parameters
OutPath
Output file path for the generated file. Defaults to theBEAKER_setfile
location.String
A raw string to pass to beaker-hostgenerator.Hypervisor
The hypervisor to select from the config file.HostsString
The name of the string from the specified hypervisor set.Force
Instructs the cmdlet to overwriteVerbose
- Notes
- If no parameters are defined.
- The default string will be used as defined in the config file.
- Either or both of
Hypervisor
orHostsString
can be used or omitted. Whichever value the cmdlet does not receive will be substituted for the defined default.
- If no parameters are defined.
- Parameters