Merge "Enable html report for content provider jobs"

This commit is contained in:
Zuul 2021-01-05 18:09:49 +00:00 committed by Gerrit Code Review
commit 36ca909418
6 changed files with 39 additions and 5 deletions

View File

@ -5,6 +5,33 @@
set_fact:
zuul_console_json: "{{ lookup('file', zuul.executor.log_root + '/job-output.json') }}"
- name: Generate build report for the container build
hosts: primary
tasks:
- name: Build report (content provider)
include_role:
name: build-containers
tasks_from: build-report
when:
- provider_job | default(false) | bool
- not use_kolla | default(false) | bool
- name: Check that the report.html exists
stat:
path: "{{ ansible_user_dir }}/workspace/logs/report.html"
register: stat_report_result
- name: Return report.html artifact to Zuul
zuul_return:
data:
zuul:
artifacts:
- name: "Build report"
url: "logs/report.html"
metadata:
type: build_report
when: stat_report_result.stat.exists
- name: Collect logs
hosts: primary
tasks:

View File

@ -42,7 +42,7 @@ def test_container_is_built(image):
pytest.skip("container image excluded: {}".format(image))
# [TEST 1]: check if image exists
cmd = ['buildah', 'images', image]
cmd = ['podman', 'images', image]
proc = subprocess.run(
cmd, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE
)

View File

@ -2,7 +2,7 @@
block:
- name: Move container-builds dir to workspace/logs
shell: "mv /tmp/container-* ./logs/"
shell: "mv {{ ansible_user_dir }}/container-* ./logs/"
become: true
args:
chdir: "{{ workspace }}"
@ -82,11 +82,17 @@
- pytest
- pytest-html
- name: install podman
become: true
package:
name: podman
state: present
- name: Execute build-report
shell: |
source "venv_build/bin/activate"
{{ virtualenv_python[ansible_distribution_major_version|int] }} -m pytest \
--html=report.html --self-contained-html {{ images_args }} build-report.py
--html=logs/report.html --self-contained-html {{ images_args }} build-report.py
args:
chdir: "{{ workspace }}"
become: true

View File

@ -19,7 +19,7 @@ openstack overcloud container image build {{ container_config }}\
--use-buildah \
{% endif %}
{% if ci_branch not in ['queens', 'rocky', 'stein'] %}
--work-dir /tmp/container-builds \
--work-dir {{ ansible_user_dir }}/container-builds \
{% endif %}
{% if build_timeout is defined %}
--build-timeout {{ build_timeout }} \

View File

@ -74,7 +74,7 @@ openstack tripleo container image build \
--prefix {{ container_name_prefix }} \
--config-file {{ openstack_git_root }}/{% if zuul_internal is defined %}openstack-{% endif %}tripleo-common/container-images/tripleo_containers.yaml \
--config-path {{ openstack_git_root }}/{% if zuul_internal is defined %}openstack-{% endif %}tripleo-common/container-images \
--work-dir /tmp/container-builds \
--work-dir {{ ansible_user_dir }}/container-builds \
{% if build_timeout is defined %}
--build-timeout {{ build_timeout }} \
{% endif %}

View File

@ -21,6 +21,7 @@
- opendev.org/openstack/ansible-collections-openstack
- opendev.org/openstack/tripleo-upgrade
- opendev.org/openstack/tripleo-ansible
- opendev.org/openstack/tripleo-common
- opendev.org/x/browbeat
- opendev.org/openstack/tripleo-ha-utils
- opendev.org/openstack/openstack-tempest-skiplist