Collect logs in post when not collected in run phase
Noticed in https://review.opendev.org/780856 when job times out logs are not collected. Collected logs can be helpful for debugging the issue for which job timed out. Change-Id: I315447073294896b1af6b94db917a11a9dfee506
This commit is contained in:
parent
0fee3ad167
commit
e6f762f780
12
playbooks/copy-logs.yaml
Normal file
12
playbooks/copy-logs.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
- hosts: all
|
||||||
|
tasks:
|
||||||
|
- name: Collect logs if not already collected
|
||||||
|
shell:
|
||||||
|
cmd: |
|
||||||
|
set -ex
|
||||||
|
if [[ ! -d "${WORKSPACE}/logs/etc" ]]; then
|
||||||
|
./copy_logs.sh
|
||||||
|
fi
|
||||||
|
executable: /bin/bash
|
||||||
|
chdir: '{{ ansible_user_dir }}/workspace/puppet-openstack-integration'
|
||||||
|
environment: '{{ zuul | zuul_legacy_vars }}'
|
@ -55,7 +55,9 @@
|
|||||||
abstract: true
|
abstract: true
|
||||||
pre-run: playbooks/prepare-node-integration.yaml
|
pre-run: playbooks/prepare-node-integration.yaml
|
||||||
run: playbooks/run-integration-tests.yaml
|
run: playbooks/run-integration-tests.yaml
|
||||||
post-run: playbooks/upload-logs.yaml
|
post-run:
|
||||||
|
- playbooks/copy-logs.yaml
|
||||||
|
- playbooks/upload-logs.yaml
|
||||||
timeout: 7200
|
timeout: 7200
|
||||||
irrelevant-files:
|
irrelevant-files:
|
||||||
- ^.*\.md$
|
- ^.*\.md$
|
||||||
|
Loading…
Reference in New Issue
Block a user