Hack hack hack...

An open journal-- some of it written for you, but most of it is for me.

Script Bootstrap

Zach Holman’s Slides on setting up a boostrap script

  • dependency check
    • is MySQL installed
    • is redis running
  • bundler
    • bundle install \ –binstubs \ –local \ –path=vendor/gems \ –without=production
  • db creation
    • rake db:create
  • db migration
    • rake db:migrate
  • db seeding
  • static page compilation
    • 404,500
  • language compilation
    • python, c, erlang

Check to see if we need bundle install

Need to bundle install?
1
2
3
md5       << File.read('Gemfile')
checksum  = md5.hexdigest
installed = File.read('.bundle/checksum').strip

Using Foreman

Permission Issues

script prompt

Slick Prompts
1
2
3
4
5
6
7
8
9
echo "the database will now be created, migrated and seeded"
echo "the current default is sqlite, if you'd like to customize your db settings"
echo "update the config/database.yml file"
echo "when finished, you may continue..."
read -p "continue (y/n)?"
  if [ $REPLY != "y" ]; then
    echo "Exiting..."
    exit 1
  fi

Comments