95
10 Things You Didn’t Know Travis-CI Could Do 2012-12-08 RejectTokyoRubyKaigi10 Murahashi “Sanemat” Kenichi

2012 12-08-travis-ci-could-do

Embed Size (px)

Citation preview

Page 1: 2012 12-08-travis-ci-could-do

10 Things You Didn’t Know Travis-CI Could Do

2012-12-08 RejectTokyoRubyKaigi10Murahashi “Sanemat” Kenichi

Page 2: 2012 12-08-travis-ci-could-do

10 Things You Didn’t Know Travis-CI Could Do

2012-12-08 RejectTokyoRubyKaigi10Murahashi “Sanemat” Kenichi

35

Page 3: 2012 12-08-travis-ci-could-do

10 Things You Didn’t Know Travis-CI Could Do

2012-12-08 RejectTokyoRubyKaigi10Murahashi “Sanemat” Kenichi

JEG2

35

Page 5: 2012 12-08-travis-ci-could-do

#1 Play Nethacklanguage: rubyrvm: 1.9.3before_script: - sudo apt-get install nethack-consolescript: - PATH=$PATH:/usr/games nethack

Page 6: 2012 12-08-travis-ci-could-do

#1 Play Nethacklanguage: rubyrvm: 1.9.3before_script: - sudo apt-get install nethack-consolescript: - PATH=$PATH:/usr/games nethack

Page 7: 2012 12-08-travis-ci-could-do

#1 Play Nethacklanguage: rubyrvm: 1.9.3 before_script: - sudo apt-get install nethack-console script: - PATH=$PATH:/usr/games nethack

NetHack, Copyright 1985-2003 By Stichting Mathematisch Centrum and M. Stephenson. See license for details.

Shall I pick a character's race, role, gender and alignment for you? [ynq]

Page 8: 2012 12-08-travis-ci-could-do

#1 Play Nethacklanguage: rubyrvm: 1.9.3 before_script: - sudo apt-get install nethack-console script: - PATH=$PATH:/usr/games nethack

NetHack, Copyright 1985-2003 By Stichting Mathematisch Centrum and M. Stephenson. See license for details.

Shall I pick a character's race, role, gender and alignment for you? [ynq] Timeout

Page 9: 2012 12-08-travis-ci-could-do

#2 Play Nethack!language: rubyrvm: 1.9.3before_script: - sudo apt-get install nethack-consolescript: - yes y | PATH=$PATH:/usr/games nethack

Page 10: 2012 12-08-travis-ci-could-do

#2 Play Nethack!

NetHack (gettty): Invalid argumententust play from a terminal.

Page 12: 2012 12-08-travis-ci-could-do

#3 Play Minecraft

Executing your script (java -cp minecraft.jar net.minecraft.LauncherFrame) took longer than 30 minutes and was terminated. Timeout

Page 13: 2012 12-08-travis-ci-could-do

#4 Build Timeouts

• http://about.travis-ci.org/docs/user/build-configuration/#Build-Timeouts“Exact timeout values vary between project types but in general are between 10 and 15 minutes for test suite runs and between 5 and 10 minutes for before scripts and so on.

Page 16: 2012 12-08-travis-ci-could-do

#0 Tracks

#1 Play Nethack, #2 Play Nethack!, #3 Play Minecraft, #4 Build Timeouts, #5 BUG: Detect wrong commit, #6 Sous Chef, #7 32bit Ubuntu, #8 All in One, #9 Quick

Feedback, #10 Freenode, #11 Mailing List, #12 Role Model: qa@it, #13 Role Models: soryu, #14 Only MAJOR MINOR TEENY, #15 Bundler Version, #16 For

Capybara, #17 Reduce Call Rake, #18 RAILS_ENV, #19 rake spec vs rspec, #20 rake spec options, #21 rake cucumber options, #22 rspec Format Document, #23 rake

COMMAND --trace, #24 Current My Best, #25 bundler_args, --without, #26 capistrano/bundler, #27 Gemfile Group, #28 Remove Unnecessary Gems, #29 Not therubyracer, But nodejs, #30 Use :ci Group?, #31 Actual Each Tests, #32 Use Travis-pro (era of closed beta), #33 Use Travis-pro public beta, #34 Travis-Pro price?, #35

Updating is worthful

Page 18: 2012 12-08-travis-ci-could-do

#0 We are Hiring!

@sanematOctober, 2012~

Page 19: 2012 12-08-travis-ci-could-do

#0 We are Hiring!

@libkazz

Page 20: 2012 12-08-travis-ci-could-do

#0 We are Hiring!

@kei_s

Page 21: 2012 12-08-travis-ci-could-do

#0 We are Hiring!

@machida

Page 22: 2012 12-08-travis-ci-could-do

#0 We are Hiring!

@is8r

Page 23: 2012 12-08-travis-ci-could-do

#0 We are Hiring!

@jugyoSeptember, 2012 ~ November, 2012

Page 25: 2012 12-08-travis-ci-could-do

#0 Tracks

#1 Play Nethack, #2 Play Nethack!, #3 Play Minecraft, #4 Build Timeouts, #5 BUG: Detect wrong commit, #6 Sous Chef, #7 32bit Ubuntu, #8 All in One, #9 Quick

Feedback, #10 Freenode, #11 Mailing List, #12 Role Model: qa@it, #13 Role Models: soryu, #14 Only MAJOR MINOR TEENY, #15 Bundler Version, #16 For

Capybara, #17 Reduce Call Rake, #18 RAILS_ENV, #19 rake spec vs rspec, #20 rake spec options, #21 rake cucumber options, #22 rspec Format Document, #23 rake

COMMAND --trace, #24 Current My Best, #25 bundler_args, --without, #26 capistrano/bundler, #27 Gemfile Group, #28 Remove Unnecessary Gems, #29 Not therubyracer, But nodejs, #30 Use :ci Group?, #31 Actual Each Tests, #32 Use Travis-pro (era of closed beta), #33 Use Travis-pro public beta, #34 Travis-Pro price?, #35

Updating is worthful

Page 28: 2012 12-08-travis-ci-could-do

#6 Sous Chef

• Sous Chef (michaelklishin/sous-chef)

• Build your own travis sandbox

• $ gem install vagrant --version ">= 1.0"$ hub clone michaelklishin/sous-chef$ cd sous-chef$ cp Vagrantfile.sample Vagrantfile$ vagrant up

Page 29: 2012 12-08-travis-ci-could-do

#6 Sous Chef

• Sous Chef (michaelklishin/sous-chef)

• Build your own travis sandbox

• $ gem install vagrant --version ">= 1.0"$ hub clone michaelklishin/sous-chef$ cd sous-chef$ cp Vagrantfile.sample Vagrantfile$ vagrant up

Page 33: 2012 12-08-travis-ci-could-do

#8 All in One

• https://github.com/travis-ci/travis-cookbooks/ci_environment

• ant, apt, bazaar, bison, build-essential, cassandra, chromium, clang, cmake, composer, couchdb, doxygen, elasticsearch, emacs, erlang, firefox, git, golang, gradle, gvm, haskell, hbase, htop, imagemagick, iptables, java, kerl, kestrel, leiningen, libffi, libgdbm, libncurses, libossp-uuid, libqt4, libreadline, libssl, libxml, libyaml, lighttpd, maven3, memcached, mercurial, mingw32, mongodb, mysql, neo4j-server, networking_basic, nodejs, openssh, openssl, perlbrew, phantomjs, php, phpbuild, phpenv, postgresql, pypy, python, rabbitmq, ragel, ramfs, rebar, redis, riak, rvm, sbt, scons, sphinx, sqlite, subversion, sweeper, sysctl, timezone, travis_build_environment, unarchivers, util-linux, vim, xserver, zeromq, zookeeper

Page 34: 2012 12-08-travis-ci-could-do

#9 Quick Feedback

Page 35: 2012 12-08-travis-ci-could-do

#9 Quick Feedback

Only Travis-pro

Page 36: 2012 12-08-travis-ci-could-do

#10 Freenode• irc.freenode.net#travis

Page 37: 2012 12-08-travis-ci-could-do

#10 Freenode• irc.freenode.net#travis

People are gathered, only when the error came out incomprehensible.

Page 38: 2012 12-08-travis-ci-could-do

#11 Mailing List• http://groups.google.com/group/travis-ci

Page 40: 2012 12-08-travis-ci-could-do

#0 Tracks

#1 Play Nethack, #2 Play Nethack!, #3 Play Minecraft, #4 Build Timeouts, #5 BUG: Detect wrong commit, #6 Sous Chef, #7 32bit Ubuntu, #8 All in One, #9 Quick

Feedback, #10 Freenode, #11 Mailing List, #12 Role Model: qa@it, #13 Role Models: soryu, #14 Only MAJOR MINOR TEENY, #15 Bundler Version, #16 For

Capybara, #17 Reduce Call Rake, #18 RAILS_ENV, #19 rake spec vs rspec, #20 rake spec options, #21 rake cucumber options, #22 rspec Format Document, #23 rake

COMMAND --trace, #24 Current My Best, #25 bundler_args, --without, #26 capistrano/bundler, #27 Gemfile Group, #28 Remove Unnecessary Gems, #29 Not therubyracer, But nodejs, #30 Use :ci Group?, #31 Actual Each Tests, #32 Use Travis-pro (era of closed beta), #33 Use Travis-pro public beta, #34 Travis-Pro price?, #35

Updating is worthful

Page 41: 2012 12-08-travis-ci-could-do

#12 Role Model: qa@it

Travis CIでサーバ側のブラウザはどう設定すれば良い? - QA@ITlanguage: rubyrvm: 1.9.3bundler_args: --without development:productionbefore_install: gem update bundlerbefore_script: - RAILS_ENV=test rake db:create db:test:load --quiet - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start

Page 42: 2012 12-08-travis-ci-could-do

#12 Role Model: qa@it

Travis CIでサーバ側のブラウザはどう設定すれば良い? - QA@ITlanguage: rubyrvm: 1.9.3bundler_args: --without development:productionbefore_install: gem update bundlerbefore_script: - RAILS_ENV=test rake db:create db:test:load --quiet - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start

8 lines

Page 43: 2012 12-08-travis-ci-could-do

#13 Role Models: soryu

Gather .travis.yml sanemat/soryu

Page 44: 2012 12-08-travis-ci-could-do

#13 Role Models: soryu

Gather .travis.yml sanemat/soryuSourceORYU

Page 45: 2012 12-08-travis-ci-could-do

#13 Role Models: soryu

Gather .travis.yml sanemat/soryuSourceORYU

PleasePull Request

Page 47: 2012 12-08-travis-ci-could-do

#0 Tracks

#1 Play Nethack, #2 Play Nethack!, #3 Play Minecraft, #4 Build Timeouts, #5 BUG: Detect wrong commit, #6 Sous Chef, #7 32bit Ubuntu, #8 All in One, #9 Quick

Feedback, #10 Freenode, #11 Mailing List, #12 Role Model: qa@it, #13 Role Models: soryu, #14 Only MAJOR MINOR TEENY, #15 Bundler Version, #16 For

Capybara, #17 Reduce Call Rake, #18 RAILS_ENV, #19 rake spec vs rspec, #20 rake spec options, #21 rake cucumber options, #22 rspec Format Document, #23 rake

COMMAND --trace, #24 Current My Best, #25 bundler_args, --without, #26 capistrano/bundler, #27 Gemfile Group, #28 Remove Unnecessary Gems, #29 Not therubyracer, But nodejs, #30 Use :ci Group?, #31 Actual Each Tests, #32 Use Travis-pro (era of closed beta), #33 Use Travis-pro public beta, #34 Travis-Pro price?, #35

Updating is worthful

Page 48: 2012 12-08-travis-ci-could-do

#14 Only MAJOR MINOR TEENY

rvm: - 1.9.3

Page 49: 2012 12-08-travis-ci-could-do

#14 Only MAJOR MINOR TEENY

rvm: - 1.9.3 Do not specify

patch level like 1.9.3-p327

Page 50: 2012 12-08-travis-ci-could-do

#15 Bundler Version

before_install: - gem update bundler

Page 51: 2012 12-08-travis-ci-could-do

#15 Bundler Version

before_install: - gem update bundler

bundle --version #=> 1.1bundle --version #=> 1.2

Page 52: 2012 12-08-travis-ci-could-do

#16 For Capybara

before_script: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start

Page 53: 2012 12-08-travis-ci-could-do

#16 For Capybara

before_script: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start

Page 54: 2012 12-08-travis-ci-could-do

#17 Reduce Call Rakebefore_script: - rake db:create - rake db:migratescript: - rake spec

before_script: - rake db:create db:migratescript: - rake spec

Page 55: 2012 12-08-travis-ci-could-do

#17 Reduce Call Rakebefore_script: - rake db:create - rake db:migratescript: - rake spec

before_script: - rake db:create db:migratescript: - rake spec

Page 56: 2012 12-08-travis-ci-could-do

#18 RAILS_ENV

- rake db:create

- RAILS_ENV=test rake db:create

Page 57: 2012 12-08-travis-ci-could-do

#18 RAILS_ENV

- rake db:create

- RAILS_ENV=test rake db:create

development, test

test

Page 58: 2012 12-08-travis-ci-could-do

#19 rake spec vs rspec

$ rake spec

$ rspec

Page 59: 2012 12-08-travis-ci-could-do

#19 rake spec vs rspec

$ rake spec

$ rspec

purge, migrate, test

only test

Page 60: 2012 12-08-travis-ci-could-do

#20 rake spec options

$ rake spec SPEC=path/to/file SPEC_OPT=’-fd’

$ rspec -fd path/to/file

Page 61: 2012 12-08-travis-ci-could-do

#20 rake spec options

$ rake spec SPEC=path/to/file SPEC_OPT=’-fd’

$ rspec -fd path/to/file

SPEC, SPEC_OPT

Page 62: 2012 12-08-travis-ci-could-do

#21 rake cucumber options

$ rake cucumber FEATURE=path/to/file

$ cucumber path/to/file

Page 63: 2012 12-08-travis-ci-could-do

#21 rake cucumber options

$ rake cucumber FEATURE=path/to/file

$ cucumber path/to/file

FEATURE

Page 64: 2012 12-08-travis-ci-could-do

#22 rspec Format Document

$ rspec -fd --color

Page 65: 2012 12-08-travis-ci-could-do

#22 rspec Format Document

$ rspec -fd --color

Page 66: 2012 12-08-travis-ci-could-do

#23 rake COMMAND --trace

$ rake db:migrate --trace

Page 67: 2012 12-08-travis-ci-could-do

#23 rake COMMAND --trace

$ rake db:migrate --trace

Page 68: 2012 12-08-travis-ci-could-do

#24 Current My Best

before_script: - RAILS_ENV=test bundle exec rake db:create db:schema:loadscript:- bundle exec rspec -fd

Page 69: 2012 12-08-travis-ci-could-do

#24 Current My Best

before_script: - RAILS_ENV=test bundle exec rake db:create db:schema:loadscript:- bundle exec rspec -fd

Page 71: 2012 12-08-travis-ci-could-do

#0 Tracks

#1 Play Nethack, #2 Play Nethack!, #3 Play Minecraft, #4 Build Timeouts, #5 BUG: Detect wrong commit, #6 Sous Chef, #7 32bit Ubuntu, #8 All in One, #9 Quick

Feedback, #10 Freenode, #11 Mailing List, #12 Role Model: qa@it, #13 Role Models: soryu, #14 Only MAJOR MINOR TEENY, #15 Bundler Version, #16 For

Capybara, #17 Reduce Call Rake, #18 RAILS_ENV, #19 rake spec vs rspec, #20 rake spec options, #21 rake cucumber options, #22 rspec Format Document, #23 rake

COMMAND --trace, #24 Current My Best, #25 bundler_args, --without, #26 capistrano/bundler, #27 Gemfile Group, #28 Remove Unnecessary Gems, #29 Not therubyracer, But nodejs, #30 Use :ci Group?, #31 Actual Each Tests, #32 Use Travis-pro (era of closed beta), #33 Use Travis-pro public beta, #34 Travis-Pro price?, #35

Updating is worthful

Page 72: 2012 12-08-travis-ci-could-do

#25 bundler_args, --without

bundler_args: --deployment --without development production

Page 73: 2012 12-08-travis-ci-could-do

#25 bundler_args, --without

bundler_args: --deployment --without development production

Page 76: 2012 12-08-travis-ci-could-do

#27 Gemfile Group

Gemfile

Page 78: 2012 12-08-travis-ci-could-do

#28 Remove Unnecessary Gems

Remove debugger, therubyracer(libv8)from Travis-CI Environment

Page 80: 2012 12-08-travis-ci-could-do

#29 Not therubyracer, But nodejs

x therubyracero nodejs

Page 81: 2012 12-08-travis-ci-could-do

#29 Not therubyracer, But nodejs

x therubyracero nodejs Travis-CI has Node.js

Page 82: 2012 12-08-travis-ci-could-do

#30 Use :ci Group?Use debugger, pry-rails in test environment, but these are unnecessary in travis environment

group :ci

Page 83: 2012 12-08-travis-ci-could-do

#30 Use :ci Group?Use debugger, pry-rails in test environment, but these are unnecessary in travis environment

group :ci

bundler-args:- without development production test

capistrano:set, :without: [:development, :test, :ci]

Page 84: 2012 12-08-travis-ci-could-do

#31 Actual Each Tests

Small toy app depends on spin-up time, but actual mostly spends each tests.

Page 85: 2012 12-08-travis-ci-could-do

#31 Actual Each Tests

Small toy app depends on spin-up time, but actual mostly spends each tests.

database cleaner, fixture, fixture replacement, mock, stub, ...

Page 87: 2012 12-08-travis-ci-could-do

#0 Tracks

#1 Play Nethack, #2 Play Nethack!, #3 Play Minecraft, #4 Build Timeouts, #5 BUG: Detect wrong commit, #6 Sous Chef, #7 32bit Ubuntu, #8 All in One, #9 Quick

Feedback, #10 Freenode, #11 Mailing List, #12 Role Model: qa@it, #13 Role Models: soryu, #14 Only MAJOR MINOR TEENY, #15 Bundler Version, #16 For

Capybara, #17 Reduce Call Rake, #18 RAILS_ENV, #19 rake spec vs rspec, #20 rake spec options, #21 rake cucumber options, #22 rspec Format Document, #23 rake

COMMAND --trace, #24 Current My Best, #25 bundler_args, --without, #26 capistrano/bundler, #27 Gemfile Group, #28 Remove Unnecessary Gems, #29 Not therubyracer, But nodejs, #30 Use :ci Group?, #31 Actual Each Tests, #32 Use Travis-pro (era of closed beta), #33 Use Travis-pro public beta, #34 Travis-Pro price?, #35

Updating is worthful

Page 92: 2012 12-08-travis-ci-could-do

#34 Travis-Pro price?

Travis CI: The Travis Plans

small plan is $129 per month, and our big

plan is $249 per month

Page 93: 2012 12-08-travis-ci-could-do

#35 Updating is worthful

Automatical update causes pain Temporarily, but this bring happy, I think.

Page 94: 2012 12-08-travis-ci-could-do

#0 Tracks

#1 Play Nethack, #2 Play Nethack!, #3 Play Minecraft, #4 Build Timeouts, #5 BUG: Detect wrong commit, #6 Sous Chef, #7 32bit Ubuntu, #8 All in One, #9 Quick

Feedback, #10 Freenode, #11 Mailing List, #12 Role Model: qa@it, #13 Role Models: soryu, #14 Only MAJOR MINOR TEENY, #15 Bundler Version, #16 For

Capybara, #17 Reduce Call Rake, #18 RAILS_ENV, #19 rake spec vs rspec, #20 rake spec options, #21 rake cucumber options, #22 rspec Format Document, #23 rake

COMMAND --trace, #24 Current My Best, #25 bundler_args, --without, #26 capistrano/bundler, #27 Gemfile Group, #28 Remove Unnecessary Gems, #29 Not therubyracer, But nodejs, #30 Use :ci Group?, #31 Actual Each Tests, #32 Use Travis-pro (era of closed beta), #33 Use Travis-pro public beta, #34 Travis-Pro price?, #35

Updating is worthful