Add repo injection capabilities to STD-CI

Description

This is a part of containers CI/CD flow implementation process.

We want to add to standard-CI ('mock-runner.sh') the capability to provide a project with information about package repositories that unrelated to the setup of the environment that standard-CI scripts run in.

A projects will specify required repositories by including one or more files that match the pattern “{{automation/$STD_CI_STAGE.*.yumrepos.*}}”, where “{{$STG_CI_STAGE}}” is e.g “{{build-system-artifacts}}” and the wildcard sections can be omitted along with the dots that precede them. The file should be in the format of a yum configuration file and include configuration for required yum repositories. To avoid the projects having to maintain URLs for yum repositories, the file may contain configurations without repository URLs specified and with the “skip_if_unavailable” parameter set to “true”. Only the names of the repository configuration sections will be meaningful for the purpose of the CI system. For each such file the CI system will:

  1. Replace any configuration section that defines the “{{ovirt-<distro-id>}}” repository with one or more configuration sections pointing to repositories from which oVirt packages for the distribution identified by "<distro-id>" may be obtained. “{{<distro-id>}}" will be a string such as “el7” or “fc25”. To allow avoiding collisions with the released oVirt yum configuration, the “{{ovirt-ci-<repoid>}}” and “{{ovirt-experimental-<repoid>}}” configuration section will be treated the same way.

  2. Replace any configuration section that defines the “{{ovirt-dependencies-<distro-id>}}” repository with one or more configuration sections pointing to repositories from which oVirt dependency packages need to be obtained. These will include, among others, base operating system packages. The “{{ovirt-ci-dependencies-<repoid>}}” and “{{ovirt-experimental-dependencies-<repoid>}}” configuration section will be treated the same way.

  3. Run the mirror injection process. Any repository handled by this process will have the the “{{skip_if_unavailable}}” parameter removed if specified (To make the default value of “{{false}}” come into effect).

  4. Prepend a “{{[main]}}” section that disables the use of the “{{/etc/yum.repos.d}}” directory. This will allow the file to appended to the "{{/etc/yun.conf}}” file to automatically disable all internet-facing preconfigured repositories.

To allow automation scripts to find the repository files prepared for them, several environment variables will be made available in the Standard-CI runtime environment:

  1. STD_CI_STAGE: Will contain the name of the Standard-CI stage, e.g. “{{build-artifacts}}”.

  2. STD_CI_DISTRO: Will contain the distribution version identifier (e.g “el7” or “fc25”) of the Standard-CI runtime.

  3. STD_CI_YUMREPOS: Will point to an existing “{{*.yumrepos}}” file that most closely matches the current running stage and distribution

Assignee

Unassigned

Reporter

Barak Korren

Blocked By

None

Components

Priority

Low
Configure