Created
October 1, 2013 21:42
-
-
Save rkh/6785596 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| language: c | |
| script: ./build.sh | |
| env: | |
| global: | |
| - "ARTIFACTS_AWS_REGION=us-east-1" | |
| - "ARTIFACTS_S3_BUCKET=travis-rubies" | |
| - secure: "..." | |
| - secure: "..." | |
| matrix: | |
| - "RUBY=ruby-head" | |
| - "RUBY=jruby-head" | |
| - "RUBY=jruby-head-d20" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -ex | |
| [[ $RUBY ]] || (echo 'please set $RUBY' && exit 1) | |
| rvm get stable | |
| rvm reload | |
| echo -n > $rvm_path/user/md5 | |
| echo -n > $rvm_path/user/sha512 | |
| rvm remove $RUBY | |
| rvm install $RUBY --movable --verify-downloads 1 | |
| rvm prepare $RUBY | |
| gem install travis-artifacts | |
| travis-artifacts upload --path $RUBY.* --target-path binary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'sinatra/base' | |
| require 'travis/client' | |
| app = Sinatra.new do | |
| # Configuration | |
| enable :logging | |
| set :travis, uri: 'https://api.travis-ci.com/', access_token: '...' | |
| set :signatures, [ | |
| "...", # ruby/ruby | |
| "..." # jruby/jruby | |
| ] | |
| # Travis client | |
| helpers Travis::Client::Methods | |
| before { @session = Travis::Client::Session.new(settings.travis) } | |
| attr_reader :session | |
| # Check authenticity | |
| before do | |
| next if settings.signatures.include? env['HTTP_AUTHORIZATION'] | |
| halt 403, "requests need to come from Travis CI" | |
| end | |
| post '/rebuild/:ruby' do | |
| repo('travis-pro/travis-rubies').last_build.jobs.each do |job| | |
| next unless job.config['env'].include? "RUBY=#{params[:ruby]}" | |
| logger.info "restarting #%s" % job.number | |
| restart job | |
| end | |
| "ok" | |
| end | |
| end | |
| run app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source 'https://rubygems.org' | |
| gem 'sinatra' | |
| gem 'travis' | |
| gem 'puma' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| web: bundle exec rackup -s puma -p $PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment