From a890292f846794b7c4b9eb560dd74251abd3112b Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 3 Jan 2018 13:18:38 -0800 Subject: [PATCH] Only copy openafs centos rpms if we built them The openafs centos packaging job only builds new rpms if the desired version doesn't have an rpm published. Otherwise it short circuits and the job ends. Unfortunately the post tasks assume the rpm will always be built so this job then fails. Fix this by checking for rpms before running the post tasks. Change-Id: I132b82d437a19f855a49d175a912792417a85ae9 --- playbooks/package-afs-centos/post.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/playbooks/package-afs-centos/post.yaml b/playbooks/package-afs-centos/post.yaml index a78dc75f..dbebbbae 100644 --- a/playbooks/package-afs-centos/post.yaml +++ b/playbooks/package-afs-centos/post.yaml @@ -1,13 +1,24 @@ - hosts: all tasks: + # We only build an RPM if one doesn't exist for the desired version. + - name: Check for built RPMs + stat: + path: '{{ ansible_user_dir }}/rpmbuild/RPMS/x86_64' + get_checksum: false + get_mime: false + get_md5: false + register: rpms_exist + - name: Ensure artifacts directory exists + when: rpms_exist.stat.exists file: state: directory path: '{{ zuul.executor.work_root }}/artifacts/package-afs-centos7' delegate_to: localhost - name: Copy RPMs back for publication + when: rpms_exist.stat.exists synchronize: src: '{{ ansible_user_dir }}/rpmbuild/RPMS/x86_64' dest: '{{ zuul.executor.work_root }}/artifacts/package-afs-centos7'