The environment file (environment.yml ) defines the information needed for MAIA Agent (MA) commands associated with scan, build, deploy and test.
The file must be stored in the directory where MAIA Agent is installed.
This chapter contains examples of the environment file and parameter descriptions.
Open the directory where MA is installed.
Create the environment file for MA, environment.yml
touch environment.yml
Open the environment file for editing.
Add parameters to the file (see parameters and example below).
Export the variables in the environment file to BLT_ENV.
export BLT_ENV=*path_to_maia_agent*/environment.yml
The column headed M/C/O in the table refers to whether the parameter/attribute is mandatory, conditional or optional. The following notation is used:
Meaning | |
---|---|
M | Mandatory – always present. |
C | Conditional – present under certain conditions (as specified in the description). |
O | Optional – can be present. |
MAIA Agent can be used scanning (SCAN) or/and Build/Deploy/Test (BDT). The activity controls the usage of parameters as indicated in the parameter list below.
Parameter | M/C/O | Description |
---|---|---|
AFTER_CHECKOUT | O (BDT) | The commands performed on a component directly after the command maia checkout. If a suite component is checked out together with its descendants, any commands for the suite are run before the descendants are checked out. The AFTER_CHECKOUT parameter can contain one or more mappings between a component and a set of commands. Each mapping is a key-value pair with the syntax component_name: set_of_commands |
BUILD_ROOT | M (BDT) | Path to the directory where finished builds are stored. Used by command maia build. |
COMPONENT_CONF_FILE | M (BDT) | Name of the component configuration file located at the root of each component. The file has .yml-format. The default name of the file is MAIA.yml |
COMPONENT_STATE_FILE | M (BDT) | Name of the file that stores states for a component. The file is used by MAIA agent to correctly perform a number of commands. The file is created by the command maia checkout and is updated by the commands maia build and maia fetch. |
DELIVERABLE_ROOT | O (BDT) | The path to the temporary directory used by maia fetch. |
ENVIRONMENT_NAME | O | Specify name to be used for build or test environment. Default value is user@hostname |
ENVIRONMENT_TAGS | O | Array of strings to identity the build or test environment. Default value is [user, hostname] |
GIT_SCAN_TRACKED_FILE | M (SCAN) | The file used to store a list of commits that are scanned. The file is created and updated by the command maia git_scan. |
KAFKA_BROKER | M | A list of the hosts that Kafka sends events to. A broker will be created for each host defined. |
KAFKA_TOPIC | M | A list of the topics to that a consumer subscribes to. The topics defined in MAIA Agent (producer) must correspond the topics in MAIA WebApp (consumer). Events with topics not defined in MAIA WebApp will not be received (consumed). |
LOG_ROOT | M | Path to the directory where logs for builds and tests are stored. The path is used by the commands maia build and maia test. |
MAIA_CORE_HOST | M | Address to the host where MAIA WebApp is installed. |
MAIA_CORE_HTTP_PORT | M | Port number used to access MAIA WebApp. |
MAIA_CORE_APP_CONTEXT | M | A part of the MAIA application URL. The full MAIA application URL is: https://MAIA_CORE_HOST:MAIA_CORE_HTTP_PORT/MAIA_CORE_APP_CONTEXT |
MAIA_CORE_API_TOKEN_FILE | M | The local path/name to the file where the token is stored. |
MAIA_CORE_USE_SSL | M | Defines whether SSL is used to access the MAIA WebApp. The parameter can be true or false. |
REPOSITORIES | M | The mapping between repository names and their source code. The REPOSITORIES parameter can contain one or more mappings to either Git or Subversion repositories. Each mapping is a key-value pair with the syntax repository_name:repository_adress |
SRC_ROOT | C (BDT) | Path to the directory that all components are checked out to. Used when MAIA Agent is controlling the cloning/updating of repositories. |
SRC_ROOT: /opt/examples/packages
BUILD_ROOT: /opt/examples/builds
DELIVERABLE_ROOT: /opt/examples/deliverables
LOG_ROOT: /opt/examples/logs
MAIA_CORE_HOST: host.example.com
MAIA_CORE_HTTP_PORT: 7777
MAIA_CORE_APP_CONTEXT: /maia
MAIA_CORE_API_TOKEN_FILE: /home/username/.maia-api-token
MAIA_CORE_USE_SSL: true
COMPONENT_CONF_FILE: MAIA.yml
COMPONENT_STATE_FILE: .maia_state.yml
GIT_SCAN_TRACKED_FILE: tracked_commits
REPOSITORIES:
ir: https://cm.example.com/svn/ir
dev: https://cm.example.com/svn/dev
manuals: https://cm.example.com/svn/manuals
(.+): ssh://user@192.168.1.199:29418/$1
AFTER_CHECKOUT:
maia_base: 'setup_suite maia_base maia.FC7'
maia_platform: 'echo maia_platform'
'maia_.*': 'setup_component maia_base --build-makeflags="ENCODE_RUBY=no"'
'.*': 'setup_component maia_base --build-makeflags="ENCODE_RUBY=no"'
KAFKA_BROKERS:
- stream.example.com:9092
KAFKA_TOPIC: MAIA
ENVIRONMENT_NAME: centos7-host3
ENVIRONMENT_TAGS:
- centos7.1
- maia
- production