deploy like a pro!
TRANSCRIPT
✔ Optimize assets✔ Run database migrations
✔ Restart dependent services
Provide rollback functionality
What is deployment?
Optimize assetsPreprocess, combine and minify styles
You can use grunt-contrib-sass & grunt-contrib-cssmin
Optimize assetsOptimize and combine font files (SVG only)
You can use the same grunt-contrib-imagemin
“A remote server automation and deployment tool written in Ruby.”
“Capistrano is written in Ruby, but it can easily be used to deploy any language.”
Capfile defines requirements for your deployment tasks→
config/deploy.rb shared configuration for all the stages→
config/deploy/*.rb defines multiple stage deployment→
lib/capistrano/tasks where your custom tasks are defined→
Lots of tasks off-the-shelf that integrate with the Ruby on Rails framework
bundler, assets, migrations, Passenger, etc...
You just need to include the gems in your Gemfile and uncomment the require in the Capfile
You can attach to any step to run custom commands using 'before' and 'after' from Capistrano DSL, eg:
Not a Rails shop?
You might need manual work creating your recipes,although there is some hope in certain cases:
capistrano-node-deploy Node.js apps→capistrano-virtualenv virtualenv python apps→
capistrano-django Django apps→capistrano-go Go apps →
Caveat emptor! Might be old, untested or unsuitable
Where to go from here?
Infrastructure management tools like Chef or Puppet for server provisioning
Continuous integration hooks for automated deployment to staging servers