.travis.yml => build.sh converter
Ruby Shell
Switch branches/tags
Clone or download
Latest commit 5aef38f Jul 17, 2018
Permalink
Failed to load latest commit information.
example_payloads add a Stage::Skip, call travis_result on script May 9, 2017
examples re-add build script example artifacts Nov 15, 2014
lib Ensure yarn path is in path Jul 17, 2018
play conditionally use the old or new format Apr 25, 2018
public Merge branch 'master' into patch-1 Apr 9, 2018
script Use github oauth token everywhere, and more cleanly Mar 14, 2018
spec Only use jdk_switcher if available Jul 16, 2018
.dockerignore update the .dockerignore file Jun 8, 2017
.gitignore TRAVIS-16 Use Sonar Scanner CLI 3.0.3 Mar 16, 2018
.rspec Changes per feedback Oct 31, 2016
.ruby-version Ensure rake specs don't stomp on each other Jan 25, 2018
.simplecov Fold together the APT source and package addons Mar 30, 2015
.travis.yml Rewrite conditional job stages a bit Jun 12, 2018
CONTRIBUTING.md First cut generic Contributing.md file for Travis Mar 19, 2013
Dockerfile Add option to dump exception backtrace to logs May 10, 2018
Gemfile Add option to dump exception backtrace to logs May 10, 2018
Gemfile.lock use travis-github_apps/sf-redis Apr 25, 2018
LICENSE Update license year to 2016 Jan 17, 2016
Procfile Wrap web execution in jemalloc, update to 2.2.3, update deps Nov 17, 2015
README.md Add option to dump exception backtrace to logs May 10, 2018
Rakefile Remove unnecessary rm_rf invocation Jul 24, 2017
config.ru i like a little space Apr 12, 2017
docker-compose.yml Use github oauth token everywhere, and more cleanly Mar 14, 2018
init.rb make travis.rb plugin work again Jun 25, 2018

README.md

Travis Build Build Status

Travis Build is a library that Travis Workers use to generate a shell based build script which is then uploaded to the VMs using SSH and executed, with the resulting output streamed back to Travis.

This code base has gone through several iterations of development, and was originally extracted from Travis Worker, before taking its current form.

Running test suites

Run

bundle exec rake

Use as addon for CLI

You can set travis-build up as a plugin for the command line client:

ln -s PATH_TO_TRAVIS_BUILD ~/.travis/travis-build
gem install bundler
bundle install --gemfile ~/.travis/travis-build/Gemfile
bundler binstubs travis

You will now be able to run the compile command, which produces the bash script that runs the specified job, except that the secure environment variables are not defined, and that the build matrix expansion is not considered.

~/.travis/travis-build/bin/travis compile

Important

The resulting script contains commands that make changes to the system on which it is executed (e.g., edit /etc/resolv.conf, install software). Some require sudo privileges and they are not easily undone.

It is highly recommended that you run this on a virtual machine.

Invocation

The command can be invoked in 3 ways:

  1. Without an argument, it produces the bash script for the local .travis.yml without considering env and matrix values (travis-build is unable to expand these keys correctly).

    $ ~/.travis/travis-build/bin/travis compile

  2. With a single integer, it produces the script for the given build (or the first job of that build matrix).

    $ ~/.travis/travis-build/bin/travis compile 8

  3. With an argument of the form M.N, it produces the bash script for the job M.N.

    $ ~/.travis/travis-build/bin/travis compile 351.2

The resultant script can be used on a (virtual) machine that closely mimics Travis CI's build environment to aid you in debugging the build failures.

Raw CLI script

In addition to the travis CLI plugin you can also run the standalone CLI script:

$ bundle exec script/compile < payload.json > build.sh

Docker container

If you want to run travis-build locally on your machine (e.g. to interact with worker), you can also run it as a docker container with docker-compose:

$ docker-compose up --build

License & copyright information

See LICENSE file.

Copyright (c) 2011-2016 Travis CI development team.