From 1dcda3ff3671426657f4087a7c65ae0c13364d3d Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 20 Aug 2020 14:10:00 +1000 Subject: [PATCH] ara-report: add option for artifact prefix After https://review.opendev.org/#/c/742971 the report is generated on the host. For system-config, this means the report ends up copied to "bridge.openstack.org/ara-report" in the logs directory; but the artifact points to the non-existant top-directory. Add a variable to allow a top-level dir to be set. Needed-By: https://review.opendev.org/747101 Change-Id: I61a7d7328b5a45fc8dee09909f9411c397dd31b6 --- roles/ara-report/README.rst | 7 +++++++ roles/ara-report/defaults/main.yaml | 4 ++++ roles/ara-report/tasks/main.yaml | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/roles/ara-report/README.rst b/roles/ara-report/README.rst index c8504107b..ce2358dbd 100644 --- a/roles/ara-report/README.rst +++ b/roles/ara-report/README.rst @@ -60,3 +60,10 @@ If ARA is enabled, generates a report or saves a copy of the ARA database. :default: ``ara`` Path to ara executable. + +.. zuul:rolevar:: ara_report_artifact_prefix + :default: None + + Prefix to add to the artifact URL reported to Zuul. If you copy + results into a subdirectory, add this here. Note this should have + a trailing ``/``. diff --git a/roles/ara-report/defaults/main.yaml b/roles/ara-report/defaults/main.yaml index e420b378c..28a75df57 100644 --- a/roles/ara-report/defaults/main.yaml +++ b/roles/ara-report/defaults/main.yaml @@ -25,3 +25,7 @@ ara_report_path: '{{ zuul.executor.log_root }}/ara' ara_compress_html: true ara_report_executable: ara + +# If you copy the ara results into a subdirectory, use this to prefix +# the location the artifact points to. +ara_report_artifact_prefix: '' diff --git a/roles/ara-report/tasks/main.yaml b/roles/ara-report/tasks/main.yaml index 743a32379..5eb2bf4d5 100644 --- a/roles/ara-report/tasks/main.yaml +++ b/roles/ara-report/tasks/main.yaml @@ -63,7 +63,7 @@ zuul: artifacts: - name: ARA report - url: "{{ ara_report_path | regex_replace('\\/$', '') | basename }}" + url: "{{ ara_report_artifact_prefix }}{{ ara_report_path | regex_replace('\\/$', '') | basename }}" rescue: - name: HTML generation rescue debug: