The Deployment Template allows the use of one or more configuration override files.
These files can be used to override or substitute values into the configuration documents. For example, developers may want to separate the specification of environment-specific configuration (e.g. hostnames, ports, etc.) from the application configuration and scripts. This may be useful for making configuration documents portable across environments and for dividing ownership of configuration elements between system administrators and application developers.
Override files are specified by using the
--config-override
flag to the EAC development toolkit's
controller. For example, the
runcommand
script in the template includes an
environment.properties file by default, though this file only contains examples
of overrides and does not specify any active overrides.
Two types of properties can be specified in an override file:
[object].[field] = [value]
- This style of override specifies the name of an object and field and sets the value for that field, overriding any value specified for that field in the XML configuration document or documents. For example:Dgraph1.port = 16000 Dgraph1.properties['restartGroup'] = B ITLHost.hostName = itl.mycompany.com
[token] = [value]
- This style of override specifies the name of a token defined in the XML config file and substitutes the specified value for that token. For example, if theAppConfig.xml
defines the following host:<host id="ITLHost" hostName="${itl.host}" port="${itl.port}" />
The override can specify the values to substitute for these tokens:
itl.host = it.mycompany.com itl.port = 8888
It is important to note that both styles of substitution are attempted
for every value defined in the override file. When a token fails to match, a
low-severity warning is logged and ignored. This is required because most
tokens will only match one of the two styles of substitution. It may be
important to avoid using token names that coincide with object names. For
example, defining the token
${Forge.tempDir}
will cause the corresponding value to
substitute for both the token as well as the
tempDir
field of the Forge component.