Closed cjus closed 7 years ago
@emadum The service user will definitely need to ensure that they don't use |
and =
inside the values they provide. I think that's reasonable. I'll update this PR to support parsing JSON as well - that's a nice addition!
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.