Browse Source

PAPR: always upload systemd logs, use verbose output and split systemd logs

Vadim Rutkovsky 7 years ago
parent
commit
512dea5297
2 changed files with 9 additions and 5 deletions
  1. 7 4
      .papr.sh
  2. 2 1
      .papr.yml

+ 7 - 4
.papr.sh

@@ -19,6 +19,7 @@ else
 fi
 export target_branch
 
+
 # Need to define some git variables for rebase.
 git config --global user.email "ci@openshift.org"
 git config --global user.name "OpenShift Atomic CI"
@@ -40,13 +41,13 @@ upload_journals() {
     -m shell -a 'journalctl --no-pager > /tmp/journal'
   ansible -vvv -i $PAPR_INVENTORY all \
     -m fetch -a "src=/tmp/journal dest=journals/{{ inventory_hostname }}.log flat=yes"
+
+  # Split large files into parts, extracting a basename and preserving extention
+  find . -iname "*.log" -execdir sh -c 'split -b 4m --numeric-suffixes --additional-suffix=.log {} $(basename {} .log)_' \; -execdir rm -rf {} \;
 }
 
 trap upload_journals ERR
 
-# Store ansible log separately
-export ANSIBLE_LOG_PATH=ansible.log
-
 # run the prerequisites play
 ansible-playbook -v -i $PAPR_INVENTORY playbooks/prerequisites.yml
 
@@ -54,11 +55,13 @@ ansible-playbook -v -i $PAPR_INVENTORY playbooks/prerequisites.yml
 ansible-playbook -v -i $PAPR_INVENTORY playbooks/deploy_cluster.yml
 
 # Run upgrade playbook (to a minor version)
-if [[ "${PAPR_RUN_UPDATE:-0}" != "0" ]]; then
+if [[ "${PAPR_RUN_UPDATE}" != "0" ]]; then
   update_version="$(echo $target_branch | sed 's/\./_/')"
   ansible-playbook -v -i $PAPR_INVENTORY playbooks/byo/openshift-cluster/upgrades/v${update_version}/upgrade.yml
 fi
 
+upload_journals
+
 ### DISABLING TESTS FOR NOW, SEE:
 ### https://github.com/openshift/openshift-ansible/pull/6132
 

+ 2 - 1
.papr.yml

@@ -32,6 +32,7 @@ packages:
   - libffi-devel
   - openssl-devel
   - redhat-rpm-config
+  - findutils
 
 context: 'fedora/27/atomic'
 
@@ -40,7 +41,7 @@ tests:
 
 artifacts:
   - journals/
-  - ansible.log
+  - ansible_logs/
 
 ---
 inherit: true