From 2b55953e70dcf6a8d482e4807a4a2e2dc6d1392e Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Mar 17 2020 11:14:16 +0000 Subject: Add check-for-tests confitional job --- diff --git a/playbooks/check-for-tests.yaml b/playbooks/check-for-tests.yaml new file mode 100644 index 0000000..a1f3478 --- /dev/null +++ b/playbooks/check-for-tests.yaml @@ -0,0 +1,18 @@ +--- +- hosts: all + tasks: + - name: Check fo tests/tests.yml exists + stat: + path: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tests/tests.yml" + register: tests_stat + - zuul_return: + data: + zuul: + child_jobs: + - rpm-test + when: tests_stat.stat.exists + - zuul_return: + data: + zuul: + child_jobs: [] + when: not tests_stat.stat.exists diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index e97c428..4868e25 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -1,4 +1,12 @@ - job: + name: check-for-tests + parent: null + nodeset: + nodes: [] + description: Check the project has a tests/tests.yml + run: playbooks/rpm/check-for-tests.yaml + +- job: name: base-cloud-fedora-latest abstract: true description: base job to run on a Fedora virtual machine @@ -118,14 +126,3 @@ target: f30 release: f30 scratch_build: false - -- job: - name: rpm-build - parent: common-koji-rpm-build - final: true - description: RPM build on for rawhide target - branches: f29 - vars: - target: f29 - release: f29 - scratch_build: false