From 5854500179e74e41b760c7505725e1bfdc35ec15 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Wed, 5 Aug 2020 21:08:37 +0000 Subject: [PATCH] shake-build: add shake_target variable This change enable user to specify custom shake target. Change-Id: I1feb24cd2c66e58da130079e85de844dfd5c6792 --- roles/shake-build/README.rst | 4 ++++ roles/shake-build/defaults/main.yaml | 1 + roles/shake-build/tasks/main.yaml | 2 +- zuul.d/general-jobs.yaml | 5 +++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/roles/shake-build/README.rst b/roles/shake-build/README.rst index 8e5714b71..fde8b7dd3 100644 --- a/roles/shake-build/README.rst +++ b/roles/shake-build/README.rst @@ -7,6 +7,10 @@ Run the shake build system command. The name of the report. +.. zuul:rolevar:: shake_target + + The name of the target to build. + .. zuul:rolevar:: zuul_work_dir :default: {{ zuul.project.src_dir }} diff --git a/roles/shake-build/defaults/main.yaml b/roles/shake-build/defaults/main.yaml index 052c284d1..307b803d4 100644 --- a/roles/shake-build/defaults/main.yaml +++ b/roles/shake-build/defaults/main.yaml @@ -1,3 +1,4 @@ shake_report_name: "shake.html" +shake_target: "" zuul_work_dir: "{{ zuul.project.src_dir }}" diff --git a/roles/shake-build/tasks/main.yaml b/roles/shake-build/tasks/main.yaml index c5a953c14..22e1652ae 100644 --- a/roles/shake-build/tasks/main.yaml +++ b/roles/shake-build/tasks/main.yaml @@ -1,6 +1,6 @@ - block: - name: Run shake - command: "shake --report={{ report_location }}" + command: "shake --report={{ report_location }} {{ shake_target }}" vars: report_location: "{{ ansible_user_dir }}/zuul-output/logs/{{ shake_report_name }}" args: diff --git a/zuul.d/general-jobs.yaml b/zuul.d/general-jobs.yaml index d7cd3a41b..b23f9adfd 100644 --- a/zuul.d/general-jobs.yaml +++ b/zuul.d/general-jobs.yaml @@ -124,5 +124,10 @@ Run the shake build system command. This job produces a shake.html report. + + .. zuul:jobvar:: shake_target + + The name of the target to build. + pre-run: playbooks/shake/pre.yaml run: playbooks/shake/run.yaml