From dcd89b26864c38f82a57a766cce595617558324c Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Thu, 14 Sep 2017 13:10:07 -0600 Subject: [PATCH] Revert "Fix linting issues found via project-config" This has syntax errors. This reverts commit d3128dab9528c44c58b7e1bff2eb834578b3cb70. Change-Id: Ida6569d384f50095cc228625c7d6e73e154270ae --- roles/configure-mirrors/handlers/main.yaml | 5 +- roles/emit-job-header/tasks/main.yaml | 3 +- .../tasks/main.yaml | 68 ++++++++----------- roles/upload-logs/tasks/main.yaml | 3 +- 4 files changed, 33 insertions(+), 46 deletions(-) diff --git a/roles/configure-mirrors/handlers/main.yaml b/roles/configure-mirrors/handlers/main.yaml index ab031fcf7..0b1352ac3 100644 --- a/roles/configure-mirrors/handlers/main.yaml +++ b/roles/configure-mirrors/handlers/main.yaml @@ -3,9 +3,6 @@ - name: Update apt cache become: yes command: apt-get update - # skip linting for above comment - tags: - - skip_ansible_lint - name: Update dnf cache become: yes @@ -26,4 +23,4 @@ command: "{{ item }}" with_items: - zypper clean - - zypper refresh + - zypper refresh \ No newline at end of file diff --git a/roles/emit-job-header/tasks/main.yaml b/roles/emit-job-header/tasks/main.yaml index 2bb7ec249..93e962887 100644 --- a/roles/emit-job-header/tasks/main.yaml +++ b/roles/emit-job-header/tasks/main.yaml @@ -1,5 +1,4 @@ -- name: include the log path role - include_role: +- include_role: name: set-zuul-log-path-fact - debug: diff --git a/roles/mirror-workspace-git-repos/tasks/main.yaml b/roles/mirror-workspace-git-repos/tasks/main.yaml index b656049d1..986b7b4a5 100644 --- a/roles/mirror-workspace-git-repos/tasks/main.yaml +++ b/roles/mirror-workspace-git-repos/tasks/main.yaml @@ -1,43 +1,35 @@ - name: Allow pushing to non-bare repo - git_config: - scope: local - name: receive.denyCurrentBranch - value: ignore - repo: "{{ ansible_user_dir }}/{{ item.src_dir}}" + command: "git config --local receive.denyCurrentBranch ignore" + args: + chdir: "{{ ansible_user_dir }}/{{ item.src_dir}}" with_items: "{{ zuul.projects }}" -- block: - # Do not lint these tasks, gets confused by git actions that cannot be done - # by git modules - tags: - - skip_ansible_lint +- name: Synchronize src repos to workspace directory + command: "git push --mirror git+ssh://{{ ansible_user }}@{{ ansible_host }}/{{ ansible_user_dir }}/{{ item.src_dir}}" + args: + chdir: "{{ zuul.executor.work_root }}/{{ item.src_dir }}" + with_items: "{{ zuul.projects }}" + delegate_to: localhost - - name: Synchronize src repos to workspace directory - command: "git push --mirror git+ssh://{{ ansible_user }}@{{ ansible_host }}/{{ ansible_user_dir }}/{{ item.src_dir}}" - args: - chdir: "{{ zuul.executor.work_root }}/{{ item.src_dir }}" - with_items: "{{ zuul.projects }}" - delegate_to: localhost +- name: Determine local HEAD + shell: "git status |head -1 |awk '{ print $NF }'" + args: + chdir: "{{ zuul.executor.work_root }}/{{ item.src_dir }}" + with_items: "{{ zuul.projects }}" + delegate_to: localhost + register: statuses - - name: Determine local HEAD - shell: "git status |head -1 |awk '{ print $NF }'" - args: - chdir: "{{ zuul.executor.work_root }}/{{ item.src_dir }}" - with_items: "{{ zuul.projects }}" - delegate_to: localhost - register: statuses - - # Do this as a multi-line shell so that we can do the loop once - - name: Update remote repository state correctly - shell: | - # Reset is needed because we pushed to a non-bare repo - git reset --hard - # Undo the config setting we did above - git config --local --unset receive.denyCurrentBranch - # checkout the branch matching the branch set up by the executor - git checkout {{ item.1.stdout }} - args: - chdir: "{{ ansible_user_dir }}/{{ item.0.src_dir }}" - with_together: - - "{{ zuul.projects }}" - - "{{ statuses.results }}" +# Do this as a multi-line shell so that we can do the loop once +- name: Update remote repository state correctly + shell: | + # Reset is needed because we pushed to a non-bare repo + git reset --hard + # Undo the config setting we did above + git config --local --unset receive.denyCurrentBranch + # checkout the branch matching the branch set up by the executor + git checkout {{ item.1.stdout }} + args: + chdir: "{{ ansible_user_dir }}/{{ item.0.src_dir }}" + with_together: + - "{{ zuul.projects }}" + - "{{ statuses.results }}" diff --git a/roles/upload-logs/tasks/main.yaml b/roles/upload-logs/tasks/main.yaml index b0f7a624f..36e986d79 100644 --- a/roles/upload-logs/tasks/main.yaml +++ b/roles/upload-logs/tasks/main.yaml @@ -1,5 +1,4 @@ -- name: include the log path role - include_role: +- include_role: name: set-zuul-log-path-fact - name: Create log directories