From ce9a90ff8f8cf0620f9982e8c256e24fead5b118 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 5 Jun 2018 15:10:08 -0500 Subject: [PATCH] Add a job variable to control javascript link copying The zuul multi-tenant dashboard job wants to make a few symlinks to simulate what would happen on a real deployment with rewrite rules. The current hard-coded behavior of copying the links causes ... havoc. Add a job variable defaulting to the current behavior which such jobs can flip if they need to. Change-Id: I751524baa80353606d74b87dbaacfe7cd8b71a5e --- roles/fetch-javascript-output/README.rst | 6 ++++++ roles/fetch-javascript-output/defaults/main.yaml | 1 + roles/fetch-javascript-output/tasks/main.yaml | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/roles/fetch-javascript-output/README.rst b/roles/fetch-javascript-output/README.rst index 150b24991..e1cd8b386 100644 --- a/roles/fetch-javascript-output/README.rst +++ b/roles/fetch-javascript-output/README.rst @@ -12,3 +12,9 @@ Collect outputs from a javascript build Directory, relative to zuul_work_dir, in which javascript output content is to be found. + +.. zuul:rolevar:: javascript_copy_links + :default: true + + Whether to copy the data pointed to by symlinks in the built content, or + to copy them as symbolic links. diff --git a/roles/fetch-javascript-output/defaults/main.yaml b/roles/fetch-javascript-output/defaults/main.yaml index 642843fe6..788c31bb7 100644 --- a/roles/fetch-javascript-output/defaults/main.yaml +++ b/roles/fetch-javascript-output/defaults/main.yaml @@ -1,2 +1,3 @@ zuul_work_dir: "{{ zuul.project.src_dir }}" javascript_content_dir: dist +javascript_copy_links: true diff --git a/roles/fetch-javascript-output/tasks/main.yaml b/roles/fetch-javascript-output/tasks/main.yaml index 1085e9840..a2febd117 100644 --- a/roles/fetch-javascript-output/tasks/main.yaml +++ b/roles/fetch-javascript-output/tasks/main.yaml @@ -115,6 +115,6 @@ src: "{{ zuul_work_dir }}/{{ javascript_content_dir }}/" dest: "{{ log_path }}/html/" mode: pull - copy_links: true + copy_links: "{{ javascript_copy_links }}" verify_host: true when: javascript_output.stat.exists