What is the current workflow to debug Travis builds locally?

混江龙づ霸主 提交于 2019-12-02 17:16:29

One way to inspect the build (not to debug, sorry) is to send the build logs to another server on failure.

Here is an example:

after_failure
  - sudo tar -czf /tmp/build-${TRAVIS_BUILD_NUMBER}-logs.tgz your-application-logs/
  - scp /tmp/build-${TRAVIS_BUILD_NUMBER}-logs.tgz travis@your-server.com:~/logs

You could send them via email, store them on a storage server or whatever.

These logs would be useful to you if you run your tests in a debug mode and include our own logs as well in the tarball.

Unfortunately, there is no good solution for testing travis-ci builds locally at the moment. The closest thing I can recommend is a Ubuntu 12.04 vagrant vm and to provision it with the Travis chef cookbooks from here. This will solve most use cases as most of the time the test failures are not from the travis software (Though when it is you're in tough luck, as most Travis software depends on the other pieces of Travis software, making it fairly difficult to set up) but from the underling OS (Ubuntu) and software such as ruby and ruby gems.

I had a crack at making a docker file for JVM builds here which works well for me. It is based of the travis published containers and utilises the Travis CLI and Travis Build projects to be able to run your .travis.yml file within a docker container.

A built JVM image is on docker hub.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!