Code Monkey home page Code Monkey logo

travis-build's Introduction

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

License & copyright information

See LICENSE file.

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

travis-build's People

Contributors

banzaiman avatar joshk avatar svenfuchs avatar sarahhodne avatar rkh avatar michaelklishin avatar jimhester avatar meatballhat avatar roidrage avatar drogus avatar akoeplinger avatar gildegoma avatar andyli avatar craigcitro avatar martinnowak avatar loicfrering avatar a14n avatar fniephaus avatar nef10 avatar cotsog avatar dougpuchalski avatar aaron1011 avatar andrewhr avatar nviennot avatar domenkozar avatar matthewbauer avatar joepvd avatar jhass avatar jeroen avatar matanlurey avatar

Watchers

James Cloos avatar Jeffry Hesse avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.