URL: https://github.com/freeipa/freeipa/pull/370
Author: frasertweedale
 Title: #370: [EXPERIMENT] ci: send build log to paste.fedoraproject.org
Action: synchronized

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/370/head:pr370
git checkout pr370
From 7601eceefccd5ab844bf94b670de242cb7040d50 Mon Sep 17 00:00:00 2001
From: Fraser Tweedale <ftwee...@redhat.com>
Date: Thu, 5 Jan 2017 12:24:59 +1000
Subject: [PATCH] ci: send build log to paste.fedoraproject.org

When the build fails, send the whole logfile to paste.fedora.org.
(because due to size constraints we currently have to tail the log
for the travis-ci transcript).

We send a gzipped file, because the raw log file exceeds the size
limit on paste.fedoraproject.org.

Due to percent-encoding of the data, the compressed file inflates by
~2.5x for transport.  If this ever becomes a problem,
base64url-encoding before transport will limit inflation to 1.33x.
---
 .travis.yml | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index 6301974..1660be9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -33,5 +33,20 @@ install:
 script:
     - travis_wait 50 ./.travis_run_task.sh
 after_failure:
+    - >
+      echo "Sending test runner output to paste.fedoraproject.org"
+      && sudo apt-get -qq update && sudo apt-get install -y jq
+      && gzip < ci_results_${TRAVIS_BRANCH}.log > ci_results.log.gz
+      && ls -l ci_results.log.gz
+    - >
+      PASTE_ID=$(curl https://paste.fedoraproject.org/~freeipa.ci/ -H Expect:
+      --data api_submit=true
+      --data mode=json
+      --data paste_lang=text
+      --data paste_expire=$(expr 86400 '*' 28)
+      --data-urlencode paste_data@ci_results.log.gz
+      | jq --raw-output .result.id)
+      && echo "Download gzipped logfile from: https://paste.fedoraproject.org/$PASTE_ID/raw/";
+      || echo "Failed to submit paste!"
     - echo "Test runner output:"; tail -n $CI_BACKLOG_SIZE $CI_RESULTS_LOG
     - echo "PEP-8 errors:"; cat $PEP8_ERROR_LOG
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to