diff options
author | Martin Babinsky <mbabinsk@redhat.com> | 2017-02-08 10:38:57 +0100 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2017-02-09 13:26:07 +0100 |
commit | 91341f4035e0d78b0adbe9a09ba69e1fd35ec26d (patch) | |
tree | 1852cd2d2f8735f95cbf7c3986918740b739c8ba /.travis.yml | |
parent | b24787a67fd8b19b9222979a963a8f28b22153ee (diff) | |
download | freeipa-91341f4035e0d78b0adbe9a09ba69e1fd35ec26d.tar.gz freeipa-91341f4035e0d78b0adbe9a09ba69e1fd35ec26d.tar.xz freeipa-91341f4035e0d78b0adbe9a09ba69e1fd35ec26d.zip |
Travis CI: Upload the logs from failed jobs to transfer.sh
When a non-lint job fails, all the relevant logs from the test runner
will be gzipped and uploaded to https://transfer.sh file sharing
service. The download link will then be displayed at the very end of the
Travis build log.
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to '.travis.yml')
-rw-r--r-- | .travis.yml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index 63019749c..04b766b35 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,8 @@ env: PEP8_ERROR_LOG="pep8_errors.log" CI_RESULTS_LOG="ci_results_${TRAVIS_BRANCH}.log" CI_BACKLOG_SIZE=5000 + CI_RUNNER_LOGS_DIR="/tmp/test-runner-logs" + CI_RUNNER_LOG_ARCHIVE="freeipa-ci-pr-${TRAVIS_PULL_REQUEST}-job-${TRAVIS_JOB_NUMBER}.tar.gz" matrix: - TASK_TO_RUN="lint" - TASK_TO_RUN="run-tests" @@ -31,7 +33,22 @@ install: git+https://github.com/freeipa/ipa-docker-test-runner@release-0-2-1 script: + - mkdir -p $CI_RUNNER_LOGS_DIR - travis_wait 50 ./.travis_run_task.sh after_failure: - echo "Test runner output:"; tail -n $CI_BACKLOG_SIZE $CI_RESULTS_LOG - echo "PEP-8 errors:"; cat $PEP8_ERROR_LOG + - > + echo "Archiving CI logs"; + if [[ "$TASK_TO_RUN" != "lint" ]]; then + tar --ignore-failed-read -uvf var_log.tar $CI_RESULTS_LOG $PEP8_ERROR_LOG; + gzip var_log.tar; + mv var_log.tar.gz $CI_RUNNER_LOG_ARCHIVE; + + transfer_url=$( + curl --upload-file \ + ./$CI_RUNNER_LOG_ARCHIVE \ + https://transfer.sh/${CI_RUNNER_LOG_ARCHIVE}) && + echo "Download log archive from ${transfer_url}" || + echo "Failed to upload log archive!"; + fi |