Build a collection component (updating)

Updated:2023-07-03

Prepare

Prepare, if not already done, the environment file and the configuration file to build a component.

​ The environment file must have following variables defined:

  • SRC_ROOT
  • BUILD_ROOT
  • DELIVERABLE_ROOT
  • LOG_ROOT
  • MAIA_CORE_HOST
  • MAIA_CORE_HTTP_PORT
  • MAIA_CORE_APP_CONTEXT
  • MAIA_CORE_USE_SSL
  • MAIA_CORE_API_TOKEN_FILE
  • COMPONENT_CONF_FILE
  • COMPONENT_STATE_FILE
  • KAFKA_BROKERS
  • KAFKA_TOPIC
  1. Check out a component with the MAIA Agent command maia checkout.

    bundle exec maia checkout -c component_name

  2. Go to the root directory of the component.

    cd <%INSTALL_PATH%>/component_name

  3. If the component has no configuration file, create a configuration file.

    touch MAIA.yml

  4. Edit the parameters in the configuration file. The file must contain at least the parameters version, rev and subcomponents.

    Example of a basic component configuration file.

    version: 4.0
    rev: 1.0.2
    subcomponents:
      -name: core
      -name: core_test
    

    Each subcomponent must have a configuration file of their own.

  5. Save the configuration file and make a commit to the version control system.

Build

  1. Use the MAIA Agent command checkout with option -s to checkout the component and its sub components for the collection.

    a. To check out the component with an activity that is posted to the MAIA WebApp:

    maia checkout -c component_name -s -z "comment"

    b. To check out the component without an activity:

    maia checkout -c component_name -s

    c. To checkout an older version of a build, add the option -l and specify a :

    maia checkout -c component_name -s -l build_label

  2. Use the MAIA Agent command build_clean to clean the build root.

    maia build_clean -c component_name

  3. Use the MAIA agent command fetch to fetch and unpack prebuilt deliverables from a repository (if defined in the configuration file).

    maia fetch -c component_name

  4. If you want to check whether the source code has changed before you build a component, use the MAIA Agent command build_check.

    maia build_check -c component_name

  5. Use the MAIA Agent command build to build the component.

    a. To build the component with an activity that is posted to MAIA WebApp:

    maia build -c component_name -p 0 -z "comment"

    b. To build the component without an activity:

    maia build -c component_name

Results