Travis/Travis-build
From charlesreid1
Main Travis page: Travis
Use travis-build (travis-convert?) as a travis.yml to build.sh converter: https://github.com/travis-ci/travis-build
Contents
Use travis-build to convert travis.yml to travis.sh
To use travis-build you need ruby stuff.
UGH I HAAAAAAAATE RUBY.
Attempt... 3? 4?
All of this happens in a Docker image (e.g., travis-garnet):
$ git clone https://github.com/travis-ci/travis-build $ cd travis-build
Now install ruby 2:
$ apt-add-repository ppa:brightbox/ruby-ng $ apt-get update $ apt-get install ruby2.2 ruby2.2-dev
Now install the rake file to build this crap:
$ bundle install $ bundle exec rake
Nope. At this point I have no clue how to install travis-build.
Attempt 5
Via https://stackoverflow.com/questions/34052460/how-to-build-install-travis-build
git clone the repo into some persistent directory (~/GitHub)
from ~/GitHub/travis-build run ln -s $(pwd) ~/.travis/travis-build (taken almost verbatim from the README)
After running travis (no arguments) - oh wait, there IS no travis command.
Attempt 6
Okay, let's just try and install Travis.
root@01a7a68152ad:/# gem install travis -v 1.8.8 --no-rdoc --no-ri Fetching: multipart-post-2.0.0.gem (100%) Fetching: faraday-0.13.1.gem (100%) Fetching: faraday_middleware-0.12.2.gem (100%) Fetching: highline-1.7.8.gem (100%) Fetching: backports-3.10.3.gem (100%) Fetching: multi_json-1.12.2.gem (100%) Fetching: addressable-2.4.0.gem (100%) Fetching: net-http-persistent-2.9.4.gem (100%) Fetching: net-http-pipeline-1.0.1.gem (100%) Fetching: gh-0.15.1.gem (100%) Fetching: launchy-2.4.3.gem (100%) Fetching: ffi-1.9.18.gem (100%) Building native extensions. This could take a while... ERROR: Error installing travis: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError) from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from extconf.rb:4:in `<main>' Gem files will remain installed in /var/lib/gems/1.9.1/gems/ffi-1.9.18 for inspection. Results logged to /var/lib/gems/1.9.1/gems/ffi-1.9.18/ext/ffi_c/gem_make.out
Nope.
Attempt 7
Tried this:
$ git clone https://github.com/travis-ci/travis-build $ cd travis-build $ docker-compose up
Should have been:
$ git clone https://github.com/travis-ci/travis-build $ cd travis-build $ docker-compose build $ docker run -ti travisbuild_web /bin/bash
aaaaand no way to use travis-build:
root@294c95445521:/usr/src/app# travis convert unknown command convert
More tries:
root@294c95445521:/usr/src/app# bundle exec rake
Attempt 8
Start over - build the travis-build Docker image:
$ git clone https://github.com/travis-ci/travis-build $ cd travis-build $ docker-compose up
Now follow the instructions on the README:
root@294c95445521:/usr/src/app# mkdir -p ~/.travis root@294c95445521:/usr/src/app# ln -s ${PWD} ~/.travis/travis-build root@294c95445521:/usr/src/app# gem install bundler root@294c95445521:/usr/src/app# bundle install --gemfile ~/.travis/travis-build/Gemfile root@294c95445521:/usr/src/app# bundler binstubs travis --force
Bingo, now we have a convert command:
root@294c95445521:/usr/src/app# travis wno_proxy is unsupported hichUsage: travis COMMAND ... Available commands: t accounts displays accounts and their subscription status branches displays the most recent build for each branch cache lists or deletes repository caches cancel cancels a job or build compile compiles a build script from .travis.yml console interactive shell disable disables a project enable enables a project encrypt encrypts values for the .travis.yml encrypt-file encrypts a file and adds decryption steps to .travis.yml endpoint displays or changes the API endpoint env show or modify build environment variables help helps you out when in dire need of information history displays a projects build history init generates a .travis.yml and enables the project lint display warnings for a .travis.yml login authenticates against the API and stores the token logout deletes the stored API token logs streams test logs monitor live monitor for what's going on open opens a build or job in the browser pubkey prints out a repository's public key raw makes an (authenticated) API call and prints out the result report generates a report useful for filing issues repos lists repositories the user has certain permissions on requests lists recent requests restart restarts a build or job settings access repository settings setup sets up an addon or deploy target show displays a build or job sshkey checks, updates or deletes an SSH key status checks status of the latest build sync triggers a new sync with GitHub token outputs the secret API token version outputs the client version whatsup lists most recent builds whoami outputs the current user run `/usr/local/bundle/bin/travis help COMMAND` for more infos
Now... it took a lot of work to figure out how to USE IT:
# travis compile -r numpy > build.sh
Then there's the task of getting the thing out of the container. Had to restart the container with a shared volume (-v flag) and run the whole process again.
Submitted a github pull request to help improve the vague documentation.