Fix project name mapping to DLRN project name (v2)
This fixes failures produced when project name doesn't starts with 'openstack/' This is intended to unblock the use of tripleo-ci that is now failing with projects that are not hosted under the 'openstack/' prefix (like for example x/tobiko). Note: removed set -u because this can break source activate on old versions of virtualenv. The role should not fail when it fails to find a mapping, so it was refactored to assured that. Also assures that the html report of Ansible is colored, making it easier to read. Change-Id: Ibb562f818419373700177f3b2e665cd4eb5e32ef Partial-Bug: #1859167 Partial-Bug: #1858890
This commit is contained in:
parent
cfb5d862d2
commit
5795847107
@ -6,6 +6,7 @@ artg_dlrn_repo_url: "https://github.com/openstack-packages/DLRN.git"
|
|||||||
artg_rdoinfo_repo_url: "https://github.com/redhat-openstack/rdoinfo"
|
artg_rdoinfo_repo_url: "https://github.com/redhat-openstack/rdoinfo"
|
||||||
artg_compressed_gating_repo: "/home/stack/gating_repo.tar.gz"
|
artg_compressed_gating_repo: "/home/stack/gating_repo.tar.gz"
|
||||||
artg_build_one: true
|
artg_build_one: true
|
||||||
|
artg_rdo_packages: []
|
||||||
dlrn_target: >-
|
dlrn_target: >-
|
||||||
{%- if ansible_distribution == "RedHat" -%}
|
{%- if ansible_distribution == "RedHat" -%}
|
||||||
redhat
|
redhat
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Converge
|
- name: Converge
|
||||||
hosts: all
|
hosts: all
|
||||||
|
tasks:
|
||||||
|
- name: Include role
|
||||||
|
include_role:
|
||||||
|
name: build-test-packages
|
||||||
|
@ -30,27 +30,26 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
loop_var: project_item
|
loop_var: project_item
|
||||||
|
|
||||||
- name: Map project name to DLRN project name
|
- block:
|
||||||
register: project_name_mapped
|
- name: Map project name to DLRN project name
|
||||||
shell: >
|
register: project_name_mapped
|
||||||
set -euo pipefail;
|
shell: >
|
||||||
source {{ build_repo_dir }}/dlrn-venv/bin/activate;
|
set -exo pipefail;
|
||||||
export PROJECT_NAME=$(echo {{ artg_change.project }} | sed "s|openstack/||");
|
source {{ build_repo_dir }}/dlrn-venv/bin/activate;
|
||||||
rdopkg findpkg -s $PROJECT_NAME -l rdoinfo | grep ^name | awk '{print $2}'
|
rdopkg findpkg -s {{ artg_change.project | basename }} -l rdoinfo | grep ^name | awk '{print $2}'
|
||||||
args:
|
args:
|
||||||
chdir: '{{ build_repo_dir }}/DLRN'
|
chdir: '{{ build_repo_dir }}/DLRN'
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- debug:
|
rescue:
|
||||||
msg: "WARNING: Unable to build {{ artg_change.project }}. No pkg found."
|
- debug:
|
||||||
when: project_name_mapped.stdout == ''
|
msg: |
|
||||||
|
WARNING: Unable to build {{ artg_change.project }}
|
||||||
|
{{ project_name_mapped }}
|
||||||
|
|
||||||
- name: Ensure artg_rdo_packages is defined
|
- when:
|
||||||
set_fact:
|
- project_name_mapped is success
|
||||||
artg_rdo_packages: []
|
- project_name_mapped.stdout != '' # noqa 602
|
||||||
when: artg_rdo_packages is not defined
|
|
||||||
|
|
||||||
- when: project_name_mapped.stdout != ''
|
|
||||||
block:
|
block:
|
||||||
- name: Append project name to package list
|
- name: Append project name to package list
|
||||||
set_fact:
|
set_fact:
|
||||||
@ -82,7 +81,9 @@
|
|||||||
refspec: '{{ artg_change.distgit.refspec }}'
|
refspec: '{{ artg_change.distgit.refspec }}'
|
||||||
version: 'FETCH_HEAD'
|
version: 'FETCH_HEAD'
|
||||||
accept_hostkey: true
|
accept_hostkey: true
|
||||||
when: artg_change.distgit is defined and (artg_repos_dir is not defined or copy_dir is failed)
|
when:
|
||||||
|
- artg_change.distgit is defined
|
||||||
|
- artg_repos_dir is not defined or copy_dir is failed
|
||||||
|
|
||||||
- name: Run DLRN
|
- name: Run DLRN
|
||||||
shell: >
|
shell: >
|
||||||
@ -107,3 +108,8 @@
|
|||||||
chdir: '{{ build_repo_dir }}/DLRN'
|
chdir: '{{ build_repo_dir }}/DLRN'
|
||||||
register: repo_built
|
register: repo_built
|
||||||
when: artg_build_one|bool
|
when: artg_build_one|bool
|
||||||
|
|
||||||
|
- name: Ensure artg_rdo_packages is defined
|
||||||
|
set_fact:
|
||||||
|
artg_rdo_packages: []
|
||||||
|
when: artg_rdo_packages is not defined
|
||||||
|
@ -173,6 +173,7 @@
|
|||||||
register: old_dlrn
|
register: old_dlrn
|
||||||
|
|
||||||
- name: Remove DLRN RPM install test
|
- name: Remove DLRN RPM install test
|
||||||
|
# noqa 303
|
||||||
shell: >
|
shell: >
|
||||||
sed -i -e 's%--postinstall%%'
|
sed -i -e 's%--postinstall%%'
|
||||||
{{ build_repo_dir }}/DLRN/scripts/build_rpm.sh
|
{{ build_repo_dir }}/DLRN/scripts/build_rpm.sh
|
||||||
@ -191,7 +192,7 @@
|
|||||||
change_id: "{{ lookup('env', 'GERRIT_CHANGE_ID') }}"
|
change_id: "{{ lookup('env', 'GERRIT_CHANGE_ID') }}"
|
||||||
branch: "{{ lookup('env', 'GERRIT_BRANCH') }}"
|
branch: "{{ lookup('env', 'GERRIT_BRANCH') }}"
|
||||||
patchset_rev: "{{ lookup('env', 'GERRIT_PATCHSET_REVISION') }}"
|
patchset_rev: "{{ lookup('env', 'GERRIT_PATCHSET_REVISION') }}"
|
||||||
when: gerrit_host != ""
|
when: gerrit_host != "" # noqa 602
|
||||||
|
|
||||||
- name: Add Jenkins changes to the change list
|
- name: Add Jenkins changes to the change list
|
||||||
set_fact:
|
set_fact:
|
||||||
@ -203,7 +204,7 @@
|
|||||||
host: "{{ lookup('env', 'ZUUL_URL')|default('https://review.opendev.org', true) }}"
|
host: "{{ lookup('env', 'ZUUL_URL')|default('https://review.opendev.org', true) }}"
|
||||||
changes: "{{ lookup('env', 'ZUUL_CHANGES') }}"
|
changes: "{{ lookup('env', 'ZUUL_CHANGES') }}"
|
||||||
branch: "{{ lookup('env', 'ZUUL_BRANCH') }}"
|
branch: "{{ lookup('env', 'ZUUL_BRANCH') }}"
|
||||||
when: zuul_changes != ""
|
when: zuul_changes != "" # noqa 602
|
||||||
|
|
||||||
- name: Add Zuul changes to the change list
|
- name: Add Zuul changes to the change list
|
||||||
set_fact:
|
set_fact:
|
||||||
@ -261,9 +262,11 @@
|
|||||||
chdir: '{{ build_repo_dir }}'
|
chdir: '{{ build_repo_dir }}'
|
||||||
|
|
||||||
- name: Compress the repo
|
- name: Compress the repo
|
||||||
|
# noqa 303
|
||||||
command: 'tar czf {{ artg_compressed_gating_repo }} gating_repo'
|
command: 'tar czf {{ artg_compressed_gating_repo }} gating_repo'
|
||||||
args:
|
args:
|
||||||
chdir: '{{ build_repo_dir }}'
|
chdir: '{{ build_repo_dir }}'
|
||||||
|
|
||||||
- name: Trigger repo injection for quickstart
|
- name: Trigger repo injection for quickstart
|
||||||
set_fact:
|
set_fact:
|
||||||
compressed_gating_repo: "{{ artg_compressed_gating_repo }}"
|
compressed_gating_repo: "{{ artg_compressed_gating_repo }}"
|
||||||
|
@ -1,3 +1,21 @@
|
|||||||
---
|
---
|
||||||
dependencies:
|
dependencies:
|
||||||
- common
|
- common
|
||||||
|
|
||||||
|
galaxy_info:
|
||||||
|
author: Red Hat
|
||||||
|
description: |
|
||||||
|
This Ansible role contains defaults for variables used in more than 2 roles
|
||||||
|
throughout the tripleo-quickstart-extras repository. All other roles in this
|
||||||
|
repository depend on this one.
|
||||||
|
license: Apache
|
||||||
|
platforms:
|
||||||
|
- name: CentOS
|
||||||
|
versions:
|
||||||
|
- 7
|
||||||
|
- 8
|
||||||
|
- name: EL
|
||||||
|
versions:
|
||||||
|
- 7
|
||||||
|
- 8
|
||||||
|
min_ansible_version: 2.8
|
||||||
|
Loading…
x
Reference in New Issue
Block a user