Configuration via environment variables¶
The console agent parameters can be configured via environment variables. The configuration file structure is used for configuration via environment variables.
Formation of environment variables¶
- Variable prefix: All environment variables begin with the
JOHNNY_
prefix. - Section path: The variable is formed based on the section path in the configuration file. Section separators are replaced with the
_
symbol. - Symbol replacement: The
"."
and"-"
symbols in section names are also converted to the_
symbol.
Example¶
Let's look at an example of setting the block-on-empty-result
flag to block the build when an empty result is received:
- Path in the configuration file:
scan.general.block-on-empty-result
; - Environment variable:
JOHNNY_SCAN_GENERAL_BLOCK_ON_EMPTY_RESULT
;
Thus, to change the value of this parameter through environment variables, you need to set the variable JOHNNY_SCAN_GENERAL_BLOCK_ON_EMPTY_RESULT
with the desired value.
Priority of settings¶
Since the agent startup parameters can be configured in three ways, when using several methods simultaneously, the agent will accept parameters in the following order of priority:
- Value of the command flag;
- Value of the environment variable;
- Value in config file.