Allow depending on changes we dont actually build

It is common practice in TripleO to depend on a documentation
change when changing some aspect of CI or dev tooling. However, we
can not actually build a package from these changes, so the job
will fail.

This change makes sure we only try to build the package if it maps
to some package in rdoinfo.  A debug message will be printed if no
package is found.

Change-Id: I076d1ed89bc8707630841cbcb2683295e935a944
Closes-Bug: 1679650
Co-Authored-By: Alex Schultz <aschultz@redhat.com>
This commit is contained in:
John Trowbridge 2017-04-04 20:38:11 +00:00 committed by Sagi Shnaidman
parent 45d316afff
commit 1ba891036e

View File

@ -38,12 +38,17 @@
rdopkg findpkg -s $PROJECT_NAME -l rdoinfo | grep ^name | awk '{print $2}'
args:
chdir: '{{ build_repo_dir }}/DLRN'
failed_when: project_name_mapped.stdout == ''
- name: Create data directory if doesn't exist yet
- debug:
msg: "WARNING: Unable to build {{ artg_change.project }}. No pkg found."
when: project_name_mapped.stdout == ''
- when: project_name_mapped.stdout != ''
block:
- name: Create data directory if doesn't exist yet
file: path="{{ build_repo_dir }}/DLRN/data/" state=directory
- name: Copy from ready directories if configured
- name: Copy from ready directories if configured
command: >
cp -raf {{ artg_repos_dir }}/{{ artg_change.project|regex_replace('openstack[^/]*/', '') }}
{{ build_repo_dir }}/DLRN/data/{{ project_name_mapped.stdout }}
@ -51,7 +56,7 @@
register: copy_dir
when: artg_repos_dir is defined
- name: Clone the gated change
- name: Clone the gated change
git:
repo: '{{ artg_change.host }}/{{ artg_change.project }}'
dest: '{{ build_repo_dir }}/DLRN/data/{{ project_name_mapped.stdout }}'
@ -59,7 +64,7 @@
version: 'FETCH_HEAD'
when: artg_repos_dir is not defined or copy_dir|failed
- name: Run DLRN
- name: Run DLRN
shell: >
set +e;
source {{ build_repo_dir }}/dlrn-venv/bin/activate;
@ -81,3 +86,4 @@
args:
chdir: '{{ build_repo_dir }}/DLRN'
register: repo_built