From 2943ce05c9c19a28a0e10ad98fa3eb2f04f7bd02 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Mon, 5 Feb 2018 10:06:39 -0500 Subject: [PATCH] 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 --- roles/mirror-workspace-git-repos/tasks/main.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/roles/mirror-workspace-git-repos/tasks/main.yaml b/roles/mirror-workspace-git-repos/tasks/main.yaml index 506aba37e..9c7a171c2 100644 --- a/roles/mirror-workspace-git-repos/tasks/main.yaml +++ b/roles/mirror-workspace-git-repos/tasks/main.yaml @@ -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 }')"