Improve hydra initialization process #128
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR seeks to improve the initialization process by offering an additional way of initializing hydra beyond the use of a configuration file and object.
The init function currently accepts a config parameter which can be an object or string. If it's a string then the string is expected to point to a file path for a configuration file. If the config parameter is an object then hydra will attempt to use the object members for initialization.
This PR adds the possibility of passing a config parameter of null or undefined. Doing so will initiate the following flow:
or:
The first format is what we already use when working with Docker containers. The second format represents a string containing pipe delimited
|
key/value pairs. The key/value pairs are separated by the=
symbol.The string is parsed and an internal config object is created.
This allows a service to be started at the command line using:
This allow allows for starting a Docker container and passing the environment variables:
A side effect of this PR is that creating test services locally does not require a config file. Only
serviceName
andservicePort
need to be defined.