diff --git a/scripts/log-collect.sh b/scripts/log-collect.sh index 3f7977e155..2e0833fce2 100755 --- a/scripts/log-collect.sh +++ b/scripts/log-collect.sh @@ -26,6 +26,7 @@ ## Vars ---------------------------------------------------------------------- export WORKING_DIR=${WORKING_DIR:-$(pwd)} export RUN_ARA=${RUN_ARA:-false} +export ARA_REPORT_TYPE=${ARA_REPORT_TYPE:-"database"} export TESTING_HOME=${TESTING_HOME:-$HOME} export TS=$(date +"%H-%M-%S") @@ -142,7 +143,7 @@ function find_files { ! -name '*.html' \ ! -name '*.subunit' \ ! -name "*.journal" \ - ! -name 'ansible.sqlite' | grep -v 'stackviz' + ! -name 'ansible.sqlite' | egrep -v 'stackviz|ara-report' } function rename_files { @@ -172,6 +173,12 @@ store_artifacts /openstack/log/ansible-logging/ "${WORKING_DIR}/logs/ansible" store_artifacts /openstack/log/ "${WORKING_DIR}/logs/openstack" store_artifacts /var/log/ "${WORKING_DIR}/logs/host" +# Build the ARA static html report if required +if [[ "$ARA_REPORT_TYPE" == "html" ]]; then + echo "Generating ARA static html report." + /opt/ansible-runtime/bin/ara generate html "${WORKING_DIR}/logs/ara-report" +fi + # Store the ara sqlite database in the openstack-ci expected path store_artifacts "${TESTING_HOME}/.ara/ansible.sqlite" "${WORKING_DIR}/logs/ara-report/" diff --git a/zuul.d/playbooks/post.yml b/zuul.d/playbooks/post.yml index 46456c9d1f..c7919ea508 100644 --- a/zuul.d/playbooks/post.yml +++ b/zuul.d/playbooks/post.yml @@ -27,6 +27,8 @@ ZUUL_PROJECT: "{{ zuul.project.short_name }}" TEST_EXIT_CODE: "{{ zuul_success | lower }}" RUN_ARA: "true" + # Some Zuul environments (such as OpenStack CI) use html based ara reports + ARA_REPORT_TYPE: "{{ ara_report_type | default('database') }}" WORKING_DIR: "{{ ansible_user_dir }}/src/opendev.org/openstack/openstack-ansible" - name: Check whether a logs folder exists