c5718f08a4
As per log in [1] and some local jobs, a register in a block as repo_built in [2] is always registered even if the task is skipped. in that case repo_built will have value: "repo_built": { "changed": false, "skip_reason": "Conditional check failed", "skipped": true } so any conditional checking "repo_built is defined" will pass even if the task registering the variable is skipped. This patch adds a condition to check if the repo_built.skipped is not defined. [1] https://review.rdoproject.org/jenkins/job/rdoinfo-tripleo-ocata-testing-centos-7-multinode-1ctlr-featureset005-nv/19/consoleFull [2] https://github.com/openstack/tripleo-quickstart-extras/blob/master/roles/build-test-packages/tasks/dlrn-build.yml#L88 Change-Id: Ib0b313cd1244de6a3916cd691e7b824b4f952f80 |
||
---|---|---|
.. | ||
defaults | ||
library | ||
meta | ||
tasks | ||
README.md |
README.md
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 locatedbuild_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 repositoryartg_rdoinfo_repo_url
-- the URL of the rdoinfo repository that contains the project definitions for DLRNartg_compressed_gating_repo
-- a full path to a compressed repository that contains all the generated rpmsartg_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 rolesartg_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.
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