Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export log files from Travis CI to GitHUB?

I am using Travis CI.org (Public repo) to execute my Builds and log is printing on Travis Home Page (Log File). I want to extract the log file/ send the log file to Git HUB or to any other external open source tool to access it.

Could you please let us know how to achieve this?

like image 498
rameshthoomu Avatar asked Oct 19 '22 14:10

rameshthoomu


1 Answers

We can deploy build artifacts to S3 : Paste the below code in .travis.yml file if you are using github and S3.

after_failure:

addons:
  artifacts:
    paths:
       - $(git ls-files -o | tr "\n" ":")

deploy:

- provider: s3
- access_key_id: $ARTIFACTS_KEY
- secret_access_key: $ARTIFACTS_SECRET
- bucket: $ARTIFACTS_BUCKET
- skip_cleanup: true
- acl: public_read

Also, if you want to send it free open source tool, you can use chunk.io. Place the below code in a shell script and call this from after_failure section from .travis.yml file:

cd path/to/directory/where/untracked files store/

count=$(git ls-files -o | wc -l)

git ls-files -o

echo ">>>>>>>>> CONTAINERS LOG FILES <<<<<<<<<<<<"

for (( i=1; i<"$count";i++ ))

do

file=$(echo $(git ls-files -o | sed "${i}q;d"))

echo "$file"

cat $file | curl -sT - chunk.io

done

echo " >>>>> testsummary log file <<<< "

cat testsummary.log | curl -sT - chunk.io
like image 89
rameshthoomu Avatar answered Dec 07 '22 00:12

rameshthoomu