tripleo-quickstart-extras/roles/build-test-packages
Attila Darazs 689d759e64 Use cachable facts to allow multiple runs
* add "cachable: true" to set_fact calls when the fact would be used by
  other roles in later runs; the other fact names were checked to make
  sure they are not referred to in other roles
* consolidate the formatting of the set_fact calls, using the proper
  yaml structure instead of `set_fact: foo=bar`

Depends-On: I987d51cc252b7ebc3972d60497234fa676864882
Change-Id: I5dd3084ead618e357b1e7d841ea2ee794bd0569a
2017-12-05 16:56:38 +01:00
..
defaults Allow pre-installed DLRN 2017-10-24 10:24:09 +00:00
library build-test-packages: Fix gerrit based dependency parsing 2017-05-17 09:08:04 +00:00
meta Integrate undercloud_user var into oooq-extras 2017-01-18 09:32:16 -05:00
tasks Use cachable facts to allow multiple runs 2017-12-05 16:56:38 +01:00
templates use pip to install delorean 2017-08-29 12:23:10 -04:00
README.md Add options to use local DLRN and CentOS mirrors 2017-08-18 15:35:23 +00:00

build-test-packages

An Ansible role for generating custom RPMSs from upstream Gerrit changes in the TripleO project using DLRN. This repo then can be injected in the tested environment, a repo file created and a yum update should start using the built RPMs.

Requirements

Role Variables

  • local_working_dir -- the directory where tripleo-quickstart is located
  • build_repo_dir -- the directory where the DLRN repo is built. The variable defaults to the home directory of the user.
  • artg_dlrn_repo_url -- the URL of the DLRN repository
  • artg_rdoinfo_repo_url -- the URL of the rdoinfo repository that contains the project definitions for DLRN
  • artg_compressed_gating_repo -- a full path to a compressed repository that contains all the generated rpms
  • artg_change_list -- a list of changes to gate. Only needed when not running in Zuul or Gerrit (see below). The format is:
  • artg_requirements -- used in roles mode, the requirements file to use for replacing the gated roles
  • artg_skipped_projects -- a list of projects that are not going to be gated. This is useful if the project is directly checked out by the gate job as this retains "Depends-On" functionality for the rest of the projects. Also useful to skip projects that DLRN cannot build.
  • artg_repos_dir -- Root directory which contains project directories with sources for build.
  • dlrn_baseurl -- URL used by DLRN to get the repo definitions when building packages
  • dlrn_use_local_mirrors -- use the local repo definitions from /etc/yum.repos.d/ for CentOS and DLRN while building packages; used upstream
artg_change_list:
    - host: "review.openstack.org"
      project: "openstack/tripleo-heat-templates"
      branch: "master"
      refspec: "refs/changes/1/123456/1"
    - host: ...

Gating with Zuul or Jenkins

The role can also work with Zuul and Jenkins based gating jobs.

In case of Zuul, the role uses ZUUL_HOST and ZUUL_CHANGES vars to parse the full set of dependent changes that were previously resolved by Zuul.

If we're running in a Jenkins environment with the Gerrit Trigger plugin, GERRIT_HOST, GERRIT_CHANGE_ID, GERRIT_BRANCH and GERRIT_PATCHSET_REVISION are used to detect the gated change. The role then searches for "Depends-On:" lines in the commit message (and recursively in the commit messages of the dependent changes) and adds all of them to the gating list. This happens through Gerrit server's public REST API.

Example Playbook

---
- name: Build custom RPMs
  hosts: virthost
  roles:
    - build-test-packages

License

Apache

Author Information

RDO-CI Team