fetch-translation-output: introduce zuul_use_fetch_output
This change enables using fetch-translation role along with the fetch-output role. By default the role still synchronizes artifacts back to the executor. Change-Id: I85c021706c1fa20f8d28b3a1f56c9435ac3836d5
This commit is contained in:
@@ -1 +1,11 @@
|
||||
Collect output from a translation build
|
||||
|
||||
**Role Variables**
|
||||
|
||||
.. zuul:rolevar:: zuul_use_fetch_output
|
||||
:default: false
|
||||
|
||||
Whether to synchronize files to the executor work dir, or to copy them
|
||||
on the test instance.
|
||||
When set to false, the role synchronizes the file to the executor.
|
||||
When set to true, the job needs to use the fetch-output role later.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
---
|
||||
zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts"
|
||||
translation_output_src: "src/{{ zuul.project.canonical_name }}/translation-source/"
|
||||
zuul_output_dir: "{{ ansible_user_dir }}/zuul-output"
|
||||
zuul_use_fetch_output: "{{ zuul_site_use_fetch_output|default(false) }}"
|
||||
|
||||
@@ -3,12 +3,22 @@
|
||||
path: "{{ translation_output_src }}"
|
||||
register: translation_files
|
||||
|
||||
- name: Collect translation source files
|
||||
synchronize:
|
||||
dest: "{{ zuul_executor_dest }}"
|
||||
mode: pull
|
||||
src: "{{ translation_output_src }}"
|
||||
verify_host: true
|
||||
owner: no
|
||||
group: no
|
||||
- block:
|
||||
- name: Collect translation source files
|
||||
synchronize:
|
||||
dest: "{{ zuul_executor_dest }}"
|
||||
mode: pull
|
||||
src: "{{ translation_output_src }}"
|
||||
verify_host: true
|
||||
owner: no
|
||||
group: no
|
||||
when: not zuul_use_fetch_output
|
||||
|
||||
- name: Copy translation source files
|
||||
copy:
|
||||
dest: "{{ zuul_output_dir }}/artifacts"
|
||||
src: "{{ translation_output_src }}"
|
||||
mode: 0755
|
||||
remote_src: true
|
||||
when: zuul_use_fetch_output
|
||||
when: translation_files.stat.exists
|
||||
|
||||
Reference in New Issue
Block a user