Created
January 14, 2013 19:47
-
-
Save anonymous/4532756 to your computer and use it in GitHub Desktop.
script/bootstrap to setup a ruby on rails project alternately for a developer or for a continuous integration (ci) server
This file contains 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
#!/usr/bin/env ruby | |
# 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](https://github.com/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 | |
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. | |
# set env vars | |
export RACK_ROOT=["..."] | |
export RACK_ENV="test" | |
# load gc ocnfig | |
# clean work dir | |
script/bootstrap | |
bin/rake | |
# gh-setup <project> | |
* apps: dropbox + homebrew + chrome + 1password + etc. | |
* dependencies: mysql + node + redis + riak + postgres + rbenv + etc. | |
* config: disk encryption + vpn + screen locks + etc. | |
* puppet | |
# deploy locking (hubon + heaven) | |
* you push a branch | |
* ci starts a build | |
* build passes | |
* you deploy branch | |
* 'heaven' prevents deploy conflicts | |
* you merge branch | |
* 'heaven' unlocks deploys | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment