Commit ae91fcb519710a1f028851517bede04ea2a71390
Exists in
master
Merge pull request #1046 from mak-it/dokku
Dokku deployment support
Showing
5 changed files
with
40 additions
and
8 deletions
Show diff stats
@@ -0,0 +1 @@ | @@ -0,0 +1 @@ | ||
1 | +/users/sign_in Errbit |
Gemfile
@@ -4,14 +4,6 @@ RAILS_VERSION = '~> 4.2.5.1' | @@ -4,14 +4,6 @@ RAILS_VERSION = '~> 4.2.5.1' | ||
4 | 4 | ||
5 | send :ruby, ENV['GEMFILE_RUBY_VERSION'] if ENV['GEMFILE_RUBY_VERSION'] | 5 | send :ruby, ENV['GEMFILE_RUBY_VERSION'] if ENV['GEMFILE_RUBY_VERSION'] |
6 | 6 | ||
7 | -detected_ruby_version = Gem::Version.new(RUBY_VERSION.dup) | ||
8 | -required_ruby_version = Gem::Version.new('2.1.0') # minimum supported version | ||
9 | - | ||
10 | -if detected_ruby_version < required_ruby_version | ||
11 | - fail "RUBY_VERSION must be at least #{required_ruby_version}, " \ | ||
12 | - "detected RUBY_VERSION #{RUBY_VERSION}" | ||
13 | -end | ||
14 | - | ||
15 | gem 'actionmailer', RAILS_VERSION | 7 | gem 'actionmailer', RAILS_VERSION |
16 | gem 'actionpack', RAILS_VERSION | 8 | gem 'actionpack', RAILS_VERSION |
17 | gem 'railties', RAILS_VERSION | 9 | gem 'railties', RAILS_VERSION |
config/boot.rb
1 | +require 'rubygems' | ||
2 | + | ||
3 | +detected_ruby_version = Gem::Version.new(RUBY_VERSION.dup) | ||
4 | +required_ruby_version = Gem::Version.new('2.1.0') # minimum supported version | ||
5 | + | ||
6 | +if detected_ruby_version < required_ruby_version | ||
7 | + fail "RUBY_VERSION must be at least #{required_ruby_version}, " \ | ||
8 | + "detected RUBY_VERSION #{RUBY_VERSION}" | ||
9 | +end | ||
10 | + | ||
1 | # Set up gems listed in the Gemfile. | 11 | # Set up gems listed in the Gemfile. |
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) | 12 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) |
3 | 13 |
docs/deployment.md
@@ -4,6 +4,7 @@ to heroku and capistrano. | @@ -4,6 +4,7 @@ to heroku and capistrano. | ||
4 | 4 | ||
5 | See specific notes on deployment via: | 5 | See specific notes on deployment via: |
6 | - [heroku](deployment/heroku.md) | 6 | - [heroku](deployment/heroku.md) |
7 | +- [dokku](deployment/dokku.md) | ||
7 | - [capistrano](deployment/capistrano.md) | 8 | - [capistrano](deployment/capistrano.md) |
8 | 9 | ||
9 | You can use a process manager to deploy Errbit, but Errbit doesn't maintain | 10 | You can use a process manager to deploy Errbit, but Errbit doesn't maintain |
@@ -0,0 +1,28 @@ | @@ -0,0 +1,28 @@ | ||
1 | +# Deploy to Dokku | ||
2 | + | ||
3 | +Deployment to Dokku is very similiar to Heroku. | ||
4 | +For more details see [Heroku](heroku.md) guide. | ||
5 | + | ||
6 | +## Create an app on dokku and push the source code | ||
7 | + | ||
8 | +```bash | ||
9 | +dokku apps:create errrbit | ||
10 | +dokku plugin:install https://github.com/dokku/dokku-mongo.git mongo | ||
11 | +dokku mongo:create errbit errbit | ||
12 | +dokku mongo:link errbit errbit | ||
13 | +dokku config:set errbit HEROKU=1 | ||
14 | +dokku config:set errbit GEMFILE_RUBY_VERSION=2.2.4 | ||
15 | +dokku config:set errbit SECRET_KEY_BASE="$(bundle exec rake secret)" | ||
16 | +dokku config:set errbit ERRBIT_HOST=some-hostname.example.com | ||
17 | +dokku config:set errbit ERRBIT_EMAIL_FROM=example@example.com | ||
18 | +dokku config:set errbit EMAIL_DELIVERY_METHOD=smtp SMTP_SERVER=172.17.42.1 | ||
19 | + | ||
20 | +git remote add dokku dokku@<host>:errbit | ||
21 | +git push dokku master | ||
22 | +``` | ||
23 | + | ||
24 | +### Prepare the DB | ||
25 | + | ||
26 | +```bash | ||
27 | +dokku run errbit rake errbit:bootstrap | ||
28 | +``` |