Skip to content

Commit

Permalink
[zuul] Add post-task for log collection
Browse files Browse the repository at this point in the history
Copies logs from the job nodes so they can be viewed in the job buildresults
  • Loading branch information
elfiesmelfie committed Jun 2, 2023
1 parent fab0b92 commit 610ec15
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
override-checkout: main
# requires: # defines a resource that needs to be available e.g. a content-provide job will provide a resource
# dependencies: # list a job that needs to run successfully for this one
#
post-run:
- ci/post-collect_logs.yml
nodeset: centos-9-crc-xxl
vars:
# vars for base-simple-crc
Expand Down
38 changes: 38 additions & 0 deletions ci/post-collect_logs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
# Based on https://raw.githubusercontent.com/openstack-k8s-operators/nova-operator/bc10c4f579f8538899ac7bc5f87bfdb62d7042a4/ci/nova-operator-base/playbooks/collect-logs.yaml
- hosts: all
name: Create zuul-output log dir
gather_facts: false
tasks:
- name: Create log dir
ansible.builtin.file:
path: "{{ ansible_user_dir }}/zuul-output/logs"
state: directory
mode: "0755"

- hosts: controller
name: Collect logs on the controller
gather_facts: false
tasks:
- name: Create log dir
ansible.builtin.file:
path: "{{ ansible_user_dir }}/zuul-output/logs/controller"
state: directory
mode: "0755"

- name: Collect general openshift cr info
ansible.builtin.shell: |
cp ~/crc-start.log .
args:
chdir: "{{ ansible_user_dir }}/zuul-output/logs/controller"
changed_when: true
ignore_errors: true

- hosts: all
name: Copy files from controller on node
gather_facts: false
tasks:
- name: Copy files from controller on node
ansible.builtin.include_role:
name: fetch-output

0 comments on commit 610ec15

Please sign in to comment.