[#89] Gather container logs in check pipeline
Change-Id: I043e7bf1cbb4cf67e3b811df1c0e84ecfc137988 Signed-off-by: Vamsi Savaram <vamsi.savaram@gmail.com>
This commit is contained in:
parent
dc9de0114b
commit
5c5ff8b46f
15
playbooks/airship-collect-container-logs.yaml
Normal file
15
playbooks/airship-collect-container-logs.yaml
Normal 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.
|
||||||
|
|
||||||
|
- hosts: all
|
||||||
|
roles:
|
||||||
|
- airship-gather-container-logs
|
15
roles/airship-gather-container-logs/defaults/main.yaml
Normal file
15
roles/airship-gather-container-logs/defaults/main.yaml
Normal 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"
|
36
roles/airship-gather-container-logs/tasks/main.yaml
Normal file
36
roles/airship-gather-container-logs/tasks/main.yaml
Normal 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
|
@ -42,6 +42,7 @@
|
|||||||
name: airship-airshipctl-build-image
|
name: airship-airshipctl-build-image
|
||||||
nodeset: airship-airshipctl-single-node
|
nodeset: airship-airshipctl-single-node
|
||||||
run: playbooks/airship-airshipctl-build-images.yaml
|
run: playbooks/airship-airshipctl-build-images.yaml
|
||||||
|
post-run: playbooks/airship-collect-container-logs.yaml
|
||||||
irrelevant-files:
|
irrelevant-files:
|
||||||
- ^.*\.md$
|
- ^.*\.md$
|
||||||
- ^docs/.*$
|
- ^docs/.*$
|
||||||
@ -50,6 +51,7 @@
|
|||||||
name: airship-airshipctl-functional-existing-k8s
|
name: airship-airshipctl-functional-existing-k8s
|
||||||
pre-run: playbooks/airship-airshipctl-deploy-existing-k8s.yaml
|
pre-run: playbooks/airship-airshipctl-deploy-existing-k8s.yaml
|
||||||
run: playbooks/airship-airshipctl-functional-existing-k8s.yaml
|
run: playbooks/airship-airshipctl-functional-existing-k8s.yaml
|
||||||
|
post-run: playbooks/airship-collect-container-logs.yaml
|
||||||
nodeset: airship-airshipctl-single-node
|
nodeset: airship-airshipctl-single-node
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
@ -73,7 +75,9 @@
|
|||||||
pre-run:
|
pre-run:
|
||||||
- playbooks/airship-airshipctl-deploy-docker.yaml
|
- playbooks/airship-airshipctl-deploy-docker.yaml
|
||||||
- playbooks/airship-airshipctl-build-gate.yaml
|
- playbooks/airship-airshipctl-build-gate.yaml
|
||||||
post-run: playbooks/airship-collect-logs.yaml
|
post-run:
|
||||||
|
- playbooks/airship-collect-logs.yaml
|
||||||
|
- playbooks/airship-collect-container-logs.yaml
|
||||||
run: playbooks/airship-airshipctl-test-runner.yaml
|
run: playbooks/airship-airshipctl-test-runner.yaml
|
||||||
nodeset: airship-airshipctl-single-32GB-bionic-node
|
nodeset: airship-airshipctl-single-32GB-bionic-node
|
||||||
vars:
|
vars:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user