update build-test-packages for centos-8

* based on the ansible_distro and version
set the appropriate build target and
dlrn server.

* set type to -local where appropriate

Change-Id: I74ce4f9ab46de4301309ae6b6fdee54a5ed869a8
This commit is contained in:
Wes Hayutin 2020-02-25 14:10:15 -07:00 committed by Chandan Kumar (raukadah)
parent b74529ce99
commit 6179852a9d
3 changed files with 54 additions and 19 deletions
roles/build-test-packages
defaults
tasks
templates

@ -8,14 +8,54 @@ artg_compressed_gating_repo: "/home/stack/gating_repo.tar.gz"
artg_build_one: true
artg_rdo_packages: []
dlrn_target: >-
{%- if ansible_distribution == "RedHat" -%}
{%- if (ansible_distribution == "RedHat") and
(dlrn_use_local_mirrors|bool) -%}
redhat-local
{%- elif (ansible_distribution == "RedHat") -%}
redhat
{%- else %}centos{% endif -%}
{%- elif (ansible_distribution == "CentOS") and
(ansible_distribution_major_version|int >= 8) and
(dlrn_use_local_mirrors|bool) -%}
centos8-local
{%- elif (ansible_distribution == "CentOS") and
(ansible_distribution_major_version|int >= 8) -%}
centos8
{%- elif (ansible_distribution == "CentOS") and
(ansible_distribution_major_version|int <= 7) and
(dlrn_use_local_mirrors|bool) -%}
centos-local
{%- else -%}
centos
{%- endif -%}
initial_dlrn_config: >-
{%- if (ansible_distribution == "RedHat") -%}
redhat
{%- elif (ansible_distribution == "CentOS") and
(ansible_distribution_major_version|int >= 8) -%}
centos8
{%- else -%}
centos
{%- endif -%}
dlrn_cleanup: false
dlrn_baseurl: >-
{%- if ansible_distribution == "RedHat" and ansible_distribution_major_version|int == 8 -%}
https://trunk.rdoproject.org/rhel8-master
{%- else %}https://trunk.rdoproject.org/centos7/{% endif -%}
{%- elif (ansible_distribution == "CentOS") and (ansible_distribution_major_version|int >= 8) -%}
https://trunk.rdoproject.org/centos8/
{%- else -%}
https://trunk.rdoproject.org/centos7/
{%- endif -%}
use_components: >-
{%- if (ansible_distribution == "CentOS") and (ansible_distribution_major_version|int >= 8) -%}
1
{%- else -%}
0
{%- endif -%}
dlrn_use_local_mirrors: false
dlrn_pre_installed: false

@ -139,32 +139,26 @@
retries: 3
delay: 5
- name: Use local {{ ansible_distribution }} mirror if available
- name: Use local {{ ansible_distribution }} mirror if available ( centos 7 and RHEL )
shell: >
set -o pipefail ;
gawk '{ print $0 }; /^# repos$/ { exit }' {{ build_repo_dir }}/DLRN/scripts/{{ ansible_distribution | lower }}.cfg
> {{ build_repo_dir }}/DLRN/scripts/{{ ansible_distribution | lower }}-local.cfg;
cat /etc/yum.repos.d/quickstart-{{ ansible_distribution | lower }}-*.repo >> {{ build_repo_dir }}/DLRN/scripts/{{ ansible_distribution | lower }}-local.cfg;
gawk '{ print $0 }; /^# repos$/ { exit }' {{ build_repo_dir }}/DLRN/scripts/{{ initial_dlrn_config }}.cfg
> {{ build_repo_dir }}/DLRN/scripts/{{ initial_dlrn_config }}-local.cfg;
cat /etc/yum.repos.d/quickstart-{{ ansible_distribution | lower }}-*.repo >> {{ build_repo_dir }}/DLRN/scripts/{{ initial_dlrn_config }}-local.cfg;
find /etc/yum.repos.d -name "delorean*repo" ! -name "delorean*build-deps.repo" -exec cat {} \; -exec echo "" \;
>> {{ build_repo_dir }}/DLRN/scripts/{{ ansible_distribution | lower }}-local.cfg;
>> {{ build_repo_dir }}/DLRN/scripts/{{ initial_dlrn_config }}-local.cfg;
find /etc/yum.repos.d -name "delorean*build-deps.repo" -exec sed 's/enabled=.*/enabled=1/g' {} \;
>> {{ build_repo_dir }}/DLRN/scripts/{{ ansible_distribution | lower }}-local.cfg;
>> {{ build_repo_dir }}/DLRN/scripts/{{ initial_dlrn_config }}-local.cfg;
{% if ansible_distribution|lower == "redhat" and ansible_distribution_major_version == "8" %}
find /etc/yum.repos.d -name "rh-cloud.repo" -exec sed 's/enabled=.*/enabled=1/g' {} \;
>> {{ build_repo_dir }}/DLRN/scripts/{{ ansible_distribution | lower }}-local.cfg;
>> {{ build_repo_dir }}/DLRN/scripts/{{ initial_dlrn_config }}-local.cfg;
{% endif %}
echo '"""' >> {{ build_repo_dir }}/DLRN/scripts/{{ ansible_distribution | lower }}-local.cfg;
echo '"""' >> {{ build_repo_dir }}/DLRN/scripts/{{ initial_dlrn_config }}-local.cfg;
mkdir -p /tmp/fake-dlrn-repos/current;
touch /tmp/fake-dlrn-repos/delorean-deps.repo;
touch /tmp/fake-dlrn-repos/current/delorean.repo;
when: dlrn_use_local_mirrors|bool
- name: Use custom target for DLRN
lineinfile:
dest: '{{ build_repo_dir }}/DLRN/projects.ini'
regexp: 'target=.*'
line: 'target={{ ansible_distribution | lower }}-local'
when: dlrn_use_local_mirrors|bool
when:
- dlrn_use_local_mirrors|bool
# FIXME(jpena): once DLRN 0.8.0 is released, we can remove this
- name: Check if DLRN/scripts/build_rpm.sh exists

@ -18,6 +18,7 @@ workers=1
gerrit_topic=rdo-FTBFS
database_connection=sqlite:///commits.sqlite
fallback_to_master=1
use_components={{ use_components }}
[gitrepo_driver]
# Options to be specified if pkginfo_driver is set to