openqa/dispatcher: don't do git checkout when not on master

Like with openqa/server, sometimes we have the fedora_openqa
checkout in some kind of testing state on staging. We want to
skip the git checkout step when this is the case. This is just
copied across from the server role.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2017-04-26 20:03:59 -07:00
parent f8b1cfbc72
commit 029da6279a

View file

@ -60,11 +60,27 @@
tags:
- packages
- name: Check tools directory exists with correct ownership
file: path=/root/fedora_openqa state=directory owner=root group=root
# we don't want to run the checkout if the tests are on a non-standard
# branch, as that usually means we're messing around on staging and
# don't want the checkout reset to HEAD.
- name: Check if tests are checked out and on a non-standard branch
command: "git status"
args:
chdir: /root/fedora_openqa
register: toolsbranch
failed_when: "1 != 1"
changed_when: "1 != 1"
check_mode: no
- name: Check out fedora_openqa (scheduler / reporter tool)
git:
repo: https://pagure.io/fedora-qa/fedora_openqa.git
dest: /root/fedora_openqa
register: gittools
when: "(toolsbranch.stderr.find('Not a git repository') != -1) or (toolsbranch.stdout.find('On branch master') != -1)"
- name: Check if fedora_openqa has ever been installed
stat: path=/usr/bin/fedora-openqa