Merge "[#89] Gather container logs in check pipeline"

This commit is contained in:
Zuul
2020-03-19 11:54:05 +00:00
committed by Gerrit Code Review
4 changed files with 71 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Should match what is set in zuul/zuul-jobs:
# roles/fetch-output/defaults/main.yaml
zuul_output_dir: "{{ ansible_user_dir }}/zuul-output"

View File

@@ -0,0 +1,36 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: set runtime logs dir
set_fact:
zuul_artifact_dir: "{{ zuul_output_dir }}/artifacts"
- name: ensure directory for runtime logs exists
file:
state: directory
path: "{{ zuul_artifact_dir }}"
- name: dump docker logs
shell: |-
journalctl --unit "docker" --no-pager > "{{ zuul_artifact_dir }}/docker.log"
when: ansible_facts.services['docker'] is defined
args:
executable: /bin/bash
become: true
- name: dump containerd logs
shell: |-
journalctl --unit "containerd" --no-pager > "{{ zuul_artifact_dir }}/containerd.log"
when: ansible_facts.services['containerd'] is defined
args:
executable: /bin/bash
become: true