deploying rails at seeclickfix

12
Deploying Rails SeeClick Fix

Upload: jeff-blasius

Post on 29-Nov-2014

148 views

Category:

Technology


4 download

DESCRIPTION

This is a presentation I gave describing how we do continuous deployments at SeeClickFix.

TRANSCRIPT

Page 1: Deploying Rails at SeeClickFix

Deploying Rails

SeeC

lickF

ix

Page 2: Deploying Rails at SeeClickFix

When you’re deploying multiple times a day, it needs to be reliable and trusted

…remove the human from the process.

SeeC

lickF

ix

Page 3: Deploying Rails at SeeClickFix

Existing Solutions

SeeC

lickF

ix

Page 4: Deploying Rails at SeeClickFix

Until you’ve felt the PainSeeC

lickF

ix

Never roll your own solution

Page 5: Deploying Rails at SeeClickFix

Capistrano’s Deploy Model

SeeC

lickF

ix

• Requires developer ssh access

• Requires reliable connection between developer and servers

• sudo is probably involved in some way

• ssh key forwarding is also probably involved

• Slow deploys hold up developers

• Deploys are conducted by humans

• Doesn’t scale

Page 6: Deploying Rails at SeeClickFix

Something’s wrong when the solution is more complicated than the problem it’s trying to solve

SeeC

lickF

ix

Page 7: Deploying Rails at SeeClickFix

Deploys at SeeClickFix

SeeC

lickF

ix

• ssh or network access not required

• dev’s console is not held up deploying

• Scales well• No complicated setup or

configuration. We can all git push• Deploys via the “merge” button• master branch is always

production

Page 8: Deploying Rails at SeeClickFix

App Servers Display Build Info

SeeC

lickF

ix

/builds/info - Shows current state

/builds/log - Shows deploy log

Page 9: Deploying Rails at SeeClickFix

Chef Builds the App Server

SeeC

lickF

ix

{ "exceptional_api_key": "", "rails_env": "production", "db": "scf_productio", "port": "3000", "service_roles": { "deploy_notifier": "app1.seeclickfix.com", "integration_syncr": "app1.seeclickfix.com", "migrator": "app1.seeclickfix.com", "cron_runner": "app1.seeclickfix.com", "queue_hosts": "app1.seeclickfix.com" }, "install_location": "/var/www/seeclickfix_prod", "repo": "ssh://[email protected]/SeeClickFix/scf.git", "branch": "master", "unicorn": { "nprocs": "4" }

1. Add a server to chef2. It builds itself3. It pulls from github

and deploys itself

Page 10: Deploying Rails at SeeClickFix

How code gets to Prod

SeeC

lickF

ix

1. devs merge to develop2. develop deploys to

test.seeclickfix.com3. Travis CI tests develop4. If CI passes, Travis

merges tested sha to master

5. master deploys to seeclickfix.com

Page 11: Deploying Rails at SeeClickFix

CI really deploys to Prod

SeeC

lickF

ix

• CI’s job queue acts like the deploy queue.

• Deploys can be skipped using the [ci skip] tag.

Page 12: Deploying Rails at SeeClickFix

SeeClickFix is Hiring!

SeeC

lickF

ix