add debug info to mirror-workspace-git-repos

Sometimes the task to determine the local HEAD of projects we've
checked out is failing in a way that we can't parse. Add a step before
the one that fails to show the full git status output to help with
debugging.

Change-Id: I095489249593442e1e9a3b346aed1ecf4135825f
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-02-05 10:06:39 -05:00
parent 65257f26d7
commit 2943ce05c9

View File

@ -17,6 +17,19 @@
tags:
- skip_ansible_lint
- name: Show git status of src repos in workspace
# Show the full git status output for each repo to debug failures
# when determining HEAD in the next task.
shell: "echo '{{ item.key }}:'; git status"
args:
chdir: "{{ zuul.executor.work_root }}/{{ item.value.src_dir }}"
with_dict: "{{ zuul.projects }}"
delegate_to: localhost
# ANSIBLE0006: Skip linting since it triggers on the "git" command,
# but status is not supported by ansible git module.
tags:
- skip_ansible_lint
- name: Determine local HEAD of projects
# Output yaml-valid dict data for projects and their current HEAD
shell: "echo '{{ item.key }}:' $(git status | head -1 |awk '{ print $NF }')"