Skip to content

Instantly share code, notes, and snippets.

@sawanoboly
Last active December 31, 2015 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sawanoboly/7970363 to your computer and use it in GitHub Desktop.
Save sawanoboly/7970363 to your computer and use it in GitHub Desktop.
Travis-CIのビルドをherokuから繰り返し実行する ref: http://qiita.com/sawanoboly/items/7f275e20fb6a643a3553
script: "./test.sh"
$ heroku apps:create travis-bash-sample
Creating travis-bash-sample... done, stack is cedar
http://travis-bash-sample.herokuapp.com/ | git@heroku.com:travis-bash-sample.git
$ git remote add heroku git@heroku.com:travis-bash-sample.git
$ git push heroku
Initializing repository, done.
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 1.12 KiB | 0 bytes/s, done.
Total 6 (delta 0), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby
# -- 以下略
$ heroku config:add TRAVIS_TOKEN="YOUR_TOKEN"
$ heroku config:add TRAVIS_BUILD="OpsRockin/travis_bash_sample"
$ heroku run rake
Running `rake` attached to terminal... up, run.7639
$ heroku addons:add scheduler:standard
Adding scheduler:standard on travis-bash-sample... done, v5 (free)
This add-on consumes dyno hours, which could impact your monthly bill. To learn more:
http://devcenter.heroku.com/addons_with_dyno_hour_usage
To manage scheduled jobs run:
heroku addons:open scheduler
Use `heroku addons:docs scheduler` to view documentation.
$ heroku addons:open scheduler
Opening scheduler:standard for travis-bash-sample... done
$ heroku logs --ps scheduler
2013-12-15T07:27:38.479645+00:00 heroku[scheduler.1943]: Starting process with command `bundle exec rake`
2013-12-15T07:27:44.896760+00:00 heroku[scheduler.1943]: Process exited with status 0
2013-12-15T07:27:44.916523+00:00 heroku[scheduler.1943]: State changed from up to complete
2013-12-15T07:27:39.142666+00:00 heroku[scheduler.1943]: State changed from starting to up
2013-12-15T07:36:32.726247+00:00 heroku[scheduler.8651]: Starting process with command `bundle exec rake`
2013-12-15T07:36:33.395186+00:00 heroku[scheduler.8651]: State changed from starting to up
2013-12-15T07:36:40.094286+00:00 heroku[scheduler.8651]: Process exited with status 0
2013-12-15T07:36:40.100911+00:00 heroku[scheduler.8651]: State changed from up to complete
require 'bundler/setup'
require 'travis'
desc 'call travis to build restart'
task :default do
Travis.access_token = ENV['TRAVIS_TOKEN']
build = Travis::Repository.find(ENV['TRAVIS_BUILD'])
build.last_build.restart
end
#!/usr/bin/env bash
curl -s -L https://www.getchef.com/chef/install.sh | bash -n && echo 'syntax OK'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment