zuul-jobs/test-playbooks/general/fetch-translation-output.yaml
Tristan Cacqueray cab4e8a1cc 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
2021-06-08 20:38:25 +00:00

34 lines
1006 B
YAML

- hosts: all
pre_tasks:
# Run ensure-output-dirs now as it is not performed speculatively
- import_role:
name: ensure-output-dirs
- name: Create fake translation
shell: |
mkdir -p src/{{ zuul.project.canonical_name }}/translation-source/
echo Hello > src/{{ zuul.project.canonical_name }}/translation-source/test
tasks:
- import_role:
name: fetch-translation-output
- import_role:
name: fetch-output
when: zuul_use_fetch_output
post_tasks:
- name: Check for artifact on the test instance
stat:
path: "{{ ansible_user_dir }}/zuul-output/artifacts/test"
register: _test_artifact
failed_when: not _test_artifact.stat.exists
when: zuul_use_fetch_output
- name: Check for artifact on the executor
stat:
path: "{{ zuul.executor.work_root }}/artifacts/test"
delegate_to: localhost
register: _executor_artifact
failed_when: not _executor_artifact.stat.exists