From 5b2f9bdef921c172262a511da7e6a89583ce9ca1 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Fri, 8 Sep 2017 19:11:19 -0700 Subject: [PATCH] Add content to support translation jobs We need a role to fetch translation output to the executor for artifact upload. We also need to be able to specify a leading path when uploading artifacts as translations go into a top dir of translation-source. Change-Id: I014d559c330803213105ce1bf83a41a3c157df9c Signed-off-by: Jesse Keating --- roles/add-fileserver/README.rst | 6 ++++++ roles/add-fileserver/tasks/main.yaml | 2 +- roles/fetch-translation-output/README.rst | 1 + roles/fetch-translation-output/defaults/main.yaml | 3 +++ roles/fetch-translation-output/tasks/main.yaml | 6 ++++++ 5 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 roles/fetch-translation-output/README.rst create mode 100644 roles/fetch-translation-output/defaults/main.yaml create mode 100644 roles/fetch-translation-output/tasks/main.yaml diff --git a/roles/add-fileserver/README.rst b/roles/add-fileserver/README.rst index cd7a0cf06..58e4389e5 100644 --- a/roles/add-fileserver/README.rst +++ b/roles/add-fileserver/README.rst @@ -20,6 +20,12 @@ in subsequent tasks or roles. the project short name will be added to the hostvars of the host as ``zuul_fileserver_project_path``. + .. zuul:rolevar:: fileserver_leading_path + + This is an optional variable that will be inserted between the base + of the path (provided by the `path` variable) and the + ``zuul.project.short_name`` final path element. + .. zuul:rolevar:: ssh_known_hosts String containing known host signature for the remote host. diff --git a/roles/add-fileserver/tasks/main.yaml b/roles/add-fileserver/tasks/main.yaml index 64098e039..584bb8454 100644 --- a/roles/add-fileserver/tasks/main.yaml +++ b/roles/add-fileserver/tasks/main.yaml @@ -19,7 +19,7 @@ add_host: name: "{{ fileserver.fqdn }}" ansible_user: "{{ fileserver.ssh_username|default(ansible_user) }}" - zuul_fileserver_project_path: "{{ fileserver.path }}/{{ zuul.project.short_name }}" + zuul_fileserver_project_path: "{{ fileserver.path }}{{ '/' + fileserver_leading_path if fileserver_leading_path is defined else ''}}/{{ zuul.project.short_name }}" - name: Add fileserver server to known hosts known_hosts: diff --git a/roles/fetch-translation-output/README.rst b/roles/fetch-translation-output/README.rst new file mode 100644 index 000000000..aa6e4205d --- /dev/null +++ b/roles/fetch-translation-output/README.rst @@ -0,0 +1 @@ +Collect output from a translation build diff --git a/roles/fetch-translation-output/defaults/main.yaml b/roles/fetch-translation-output/defaults/main.yaml new file mode 100644 index 000000000..97a1f7b6a --- /dev/null +++ b/roles/fetch-translation-output/defaults/main.yaml @@ -0,0 +1,3 @@ +--- +zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts" +translation_output_src: "src/{{ zuul.project.canonical_name }}/*.pot" diff --git a/roles/fetch-translation-output/tasks/main.yaml b/roles/fetch-translation-output/tasks/main.yaml new file mode 100644 index 000000000..e2d4a28d2 --- /dev/null +++ b/roles/fetch-translation-output/tasks/main.yaml @@ -0,0 +1,6 @@ +- name: Collect translation source files + synchronize: + dest: "{{ zuul_executor_dest }}" + mode: pull + src: "{{ translation_output_src }}" + verify_host: true