First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel
Then ssh with root account, run this in termianl:
$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash| #!/bin/sh | |
| # Setup encrypted disk image | |
| # For Ubuntu 14.04 LTS | |
| CRYPTFS_ROOT=/cryptfs | |
| apt-get update | |
| apt-get -y upgrade | |
| apt-get -y install cryptsetup |
| index | |
| home | |
| top | |
| help | |
| about | |
| security | |
| contact | |
| connect | |
| support | |
| faq |
| #Deploy and rollback on Heroku in staging and production | |
| task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
| task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
| namespace :deploy do | |
| PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU' | |
| STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU' | |
| task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag] | |
| task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on] |
| # config/initializers/active_admin.rb | |
| require 'active_admin_custom_filter' | |
| ActiveAdmin.setup do |config| | |
| # ... | |
| end |
| # Add these two gems | |
| gem 'ice_cube', '0.9.3' | |
| gem 'squeel', '1.0.16' |
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
| # config/initializers/active_admin.rb | |
| require 'active_admin_custom_filter' | |
| ActiveAdmin.setup do |config| | |
| # ... | |
| end |
| # Bundler Integration | |
| require "bundler/capistrano" | |
| # Application Settings | |
| set :application, "yourapplicationname" | |
| set :user, "serveruser" | |
| set :deploy_to, "/home/#{user}/rails-applications/#{application}" | |
| set :rails_env, "production" | |
| set :use_sudo, false | |
| set :keep_releases, 3 |