Upload
jeff-blasius
View
148
Download
4
Embed Size (px)
DESCRIPTION
This is a presentation I gave describing how we do continuous deployments at SeeClickFix.
Citation preview
Deploying Rails
SeeC
lickF
ix
When you’re deploying multiple times a day, it needs to be reliable and trusted
…remove the human from the process.
SeeC
lickF
ix
Existing Solutions
SeeC
lickF
ix
Until you’ve felt the PainSeeC
lickF
ix
Never roll your own solution
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
Something’s wrong when the solution is more complicated than the problem it’s trying to solve
SeeC
lickF
ix
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
App Servers Display Build Info
SeeC
lickF
ix
/builds/info - Shows current state
/builds/log - Shows deploy log
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
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
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.
SeeClickFix is Hiring!
SeeC
lickF
ix