-
a la zachholman http://zachholman.com/talk/ruby-patterns/
-
dependency checks
- is mysql installed? (here's how to install it)
- is redis running? (here's how to run it)
-
bundler
bundle install --binstubs --local --path=vendor/gems --without=production
-
db creation
rake db:create
-
db migration
rake db:migrate
-
db seeding
- script/replicate-repo see rtomayko/replicate
- e.g.
script/replicate-repo holman/spark
(clones issues, pull requests, users, git data, etc)
-
asset / static page compilation
- 404, 500
-
language compilation
- python, c, erlang...
-
cache bootstrap results
- Check if we need to bundle install Gemfile and assets
script
md5 << File.read('Gemfile')
checksum = md5.hexdigest
installed = File.read('.bundle/checksum').strip
- We add script/cibuild to most projects. Lets us keep test config in the repository.
script
# set env vars
export RACK_ROOT=["..."]
export RACK_ENV="test"
# load gc ocnfig
# clean work dir
script/bootstrap
bin/rake
- apps: dropbox + homebrew + chrome + 1password + etc.
- dependencies: mysql + node + redis + riak + postgres + rbenv + etc.
- config: disk encryption + vpn + screen locks + etc.
- puppet
- you push a branch
- ci starts a build
- build passes
- you deploy branch
- 'heaven' prevents deploy conflicts
- you merge branch
- 'heaven' unlocks deploys