From a9f5b9f84e6e9463e20204b9c117277802e66bbf Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Fri, 12 Jan 2018 11:40:00 +0000 Subject: [PATCH] Allow check experimental jobs to gather logs The experimental jobs would not have scripts/test-log-collect.sh in src/zuul.project.canonical_name, so we need to point to the appropriate folder. This is already done for the run job, so we are re-using the same mechanics. Change-Id: I26cc8c808fb34c426d5599e0023f9285c66cf1ed --- zuul.d/playbooks/post.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/zuul.d/playbooks/post.yml b/zuul.d/playbooks/post.yml index 93113798d3..3f9c524431 100644 --- a/zuul.d/playbooks/post.yml +++ b/zuul.d/playbooks/post.yml @@ -15,18 +15,30 @@ - hosts: all tasks: + - name: Set current test repo (cross-repo) + set_fact: + current_test_repo: "git.openstack.org/{{ osa_test_repo }}" + when: + - osa_test_repo is defined + + - name: Set current test repo (non-cross-repo) + set_fact: + current_test_repo: "{{ zuul.project.canonical_name }}" + when: + - osa_test_repo is not defined + - name: Run log collection script command: scripts/test-log-collect.sh become: yes become_user: root args: - chdir: "src/{{ zuul.project.canonical_name }}" + chdir: "src/{{ current_test_repo }}" environment: # ZUUL_PROJECT is used by the log collection functions to enable # log collection configuration specific to OpenStack CI ZUUL_PROJECT: "{{ zuul.project.short_name }}" - name: Copy logs back to the executor synchronize: - src: "src/{{ zuul.project.canonical_name }}/logs" + src: "src/{{ current_test_repo }}/logs" dest: "{{ zuul.executor.log_root }}" mode: pull