Add ability to have dlrn build all the packages at once
By default, we currently loop through the packages to build and build them one at a time. It is possible to have dlrn handle building all the packages in a single invocation of dlrn. This patch adds a new variable to the build-test-packages role called artg_build_one that switches between these two package building methods. Change-Id: I98fd6cde44f8e4b693d79fbd5abb77b8636a84c9
This commit is contained in:
parent
5ef81585c2
commit
0e2ca879ee
@ -32,6 +32,9 @@ Role Variables
|
|||||||
to skip projects that DLRN cannot build.
|
to skip projects that DLRN cannot build.
|
||||||
* `artg_repos_dir` -- Root directory which contains project directories with
|
* `artg_repos_dir` -- Root directory which contains project directories with
|
||||||
sources for build.
|
sources for build.
|
||||||
|
* `artg_build_one` -- Boolean to indicate if dlrn should build one package at a
|
||||||
|
time. If set to false, dlrn will be run to build all the required packages
|
||||||
|
in one invocation of dlrn.
|
||||||
* `dlrn_target` -- Target for the DLRN build Can be something like centos or
|
* `dlrn_target` -- Target for the DLRN build Can be something like centos or
|
||||||
fedora. Defaults to centos.
|
fedora. Defaults to centos.
|
||||||
* `dlrn_baseurl` -- URL used by DLRN to get the repo definitions when building
|
* `dlrn_baseurl` -- URL used by DLRN to get the repo definitions when building
|
||||||
|
@ -5,6 +5,7 @@ build_repo_dir: "{{ ansible_user_dir }}"
|
|||||||
artg_dlrn_repo_url: "https://github.com/openstack-packages/DLRN.git"
|
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
|
||||||
dlrn_target: centos
|
dlrn_target: centos
|
||||||
dlrn_cleanup: false
|
dlrn_cleanup: false
|
||||||
dlrn_baseurl: "https://trunk.rdoproject.org/centos7/"
|
dlrn_baseurl: "https://trunk.rdoproject.org/centos7/"
|
||||||
|
@ -43,8 +43,17 @@
|
|||||||
msg: "WARNING: Unable to build {{ artg_change.project }}. No pkg found."
|
msg: "WARNING: Unable to build {{ artg_change.project }}. No pkg found."
|
||||||
when: project_name_mapped.stdout == ''
|
when: project_name_mapped.stdout == ''
|
||||||
|
|
||||||
|
- name: Ensure artg_rdo_packages is defined
|
||||||
|
set_fact:
|
||||||
|
artg_rdo_packages: []
|
||||||
|
when: artg_rdo_packages is not defined
|
||||||
|
|
||||||
- when: project_name_mapped.stdout != ''
|
- when: project_name_mapped.stdout != ''
|
||||||
block:
|
block:
|
||||||
|
- name: Append project name to package list
|
||||||
|
set_fact:
|
||||||
|
artg_rdo_packages: '{{ artg_rdo_packages }} + {{ [ project_name_mapped.stdout ] }}'
|
||||||
|
|
||||||
- name: Create data directory if doesn't exist yet
|
- name: Create data directory if doesn't exist yet
|
||||||
file: path="{{ build_repo_dir }}/DLRN/data/" state=directory
|
file: path="{{ build_repo_dir }}/DLRN/data/" state=directory
|
||||||
|
|
||||||
@ -95,4 +104,5 @@
|
|||||||
args:
|
args:
|
||||||
chdir: '{{ build_repo_dir }}/DLRN'
|
chdir: '{{ build_repo_dir }}/DLRN'
|
||||||
register: repo_built
|
register: repo_built
|
||||||
|
when: artg_build_one|bool
|
||||||
|
|
||||||
|
@ -154,6 +154,31 @@
|
|||||||
- item.project not in artg_skipped_projects
|
- item.project not in artg_skipped_projects
|
||||||
- release in item.branch
|
- release in item.branch
|
||||||
|
|
||||||
|
- name: Run DLRN
|
||||||
|
shell: >
|
||||||
|
set +e;
|
||||||
|
source {{ build_repo_dir }}/dlrn-venv/bin/activate;
|
||||||
|
while true; do
|
||||||
|
dlrn --config-file projects.ini --head-only --package-name {{ artg_rdo_packages|join(' --package-name ') }} --local --info-repo rdoinfo --dev --order;
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
# SUCCESS
|
||||||
|
break;
|
||||||
|
elif [ $? -eq 1 ]; then
|
||||||
|
# FAILED
|
||||||
|
exit 1;
|
||||||
|
elif [ $? -eq 2 ]; then
|
||||||
|
# RETRY
|
||||||
|
continue;
|
||||||
|
fi;
|
||||||
|
# Unexpected DLRN return code
|
||||||
|
exit $?;
|
||||||
|
done;
|
||||||
|
args:
|
||||||
|
chdir: '{{ build_repo_dir }}/DLRN'
|
||||||
|
register: repo_built
|
||||||
|
when: not artg_build_one|bool
|
||||||
|
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Create a directory to hold the rpms
|
- name: Create a directory to hold the rpms
|
||||||
file:
|
file:
|
||||||
|
Loading…
Reference in New Issue
Block a user