Commit 51feadb2 by tady (Masato TADA)

Merge pull request #137 from tadyjp/heroku

Move to Heroku
parents 24988b65 baac0c67
RV_RENDEZVOUS_APP_HOST=http://localhost:3000
RV_GOOGLE_API_CLIENT_ID=xxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
RV_GOOGLE_API_SECRET=xxxxxxxxxxxxxxxxxxxxxxxx
RV_S3_ASSESS_KEY_ID=xxxxxxxxxxxxxxxxxxxxxxxx
RV_S3_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
RV_S3_BACKET_NAME=xxxxxxxxxxxxxxxxxxxxx
RV_PDF_UPLOADING=1
DATABASE_URL=mysql2://user:passwd@localhost/rendezvous_development
RV_ALLOW_IPS=1.1.1.1,2.2.2.2
......@@ -17,19 +17,17 @@
/log/*.log
/tmp
/coverage/.*
*.bk
/db/*.sql
# secret files
/config/database.yml
/config/settings.yml
/backup
/script/backup.sh
.rbenv-gemsets
.ruby-version
.env
!.env.sample
bundler_args: "--without development --path=~/.bundle"
language: ruby
rvm:
- 2.1.2
- 2.1.4
env:
matrix:
- DB_TEST_DATABASE=rendezvous_test DB_TEST_USER=travis
......@@ -20,8 +20,6 @@ before_install:
- sh ./script/travis/bundle_install.sh
before_script:
- mysql -e 'CREATE DATABASE rendezvous_test;'
- cp config/database.yml.example config/database.yml
- cp config/settings.yml.example config/settings.yml
after_script:
- ruby script/travis/bundle_cache.rb
script: bundle exec rake db:create db:test:load spec teaspoon
source 'https://rubygems.org'
ruby '2.1.4'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 4.1'
......@@ -91,6 +93,8 @@ group :development, :test do
gem 'teaspoon'
gem 'guard-teaspoon'
gem 'byebug'
gem 'dotenv-rails'
end
group :test do
......@@ -149,3 +153,11 @@ gem 'hipchat'
# For PDF upload
gem 'rmagick', :require => 'RMagick'
# for heroku
gem 'rails_12factor', group: :production
gem 'mysql'
# for IP restriction
gem 'rack-contrib', require: 'rack/contrib'
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
......@@ -11,8 +11,7 @@ A simple markdown-based blog & wiki system for team.
# Supported versions
- Ruby 2.0.0
- Rails 4.1.0
- Ruby 2.1.4
# How to install and use.
......@@ -41,15 +40,7 @@ and get
-`rendevous` in [Project name] in Consent screen
## Create and edit config files.
```
$ cp config/database.yml.example config/database.yml
$ vim config/database.yml
$ cp config/settings.yml.example config/settings.yml
$ vim config/settings.yml
```
## Dotenv
## Setup DB
......
......@@ -32,6 +32,11 @@ module Rendezvous
# oauth2_token: 'FIXME',
# account: 'FIXME'
}
# IP restriction.
if Rails.env.production? && ENV['RV_ALLOW_IPS']
config.middleware.use Rack::Access, { "/" => ENV['RV_ALLOW_IPS'].split(/,/) }
end
end
end
# Read Me
# Copy this file to `database.yml` when you run first development.
# $ cp config/detabase.yml.example config/database.yml
development:
adapter: mysql2
encoding: utf8
reconnect: false
pool: 5
host: localhost
database: rendezvous_development
username: rendezvous
password: rendezvous
url: <%= ENV['DATABASE_URL'] %>
test:
adapter: mysql2
......
# Read Me
# Copy this file to `settings.yml` when you run first development.
# $ cp config/settings.yml.example config/settings.yml
defaults: &defaults
rendezvous:
# For amil body
app_host: "http://rendezvous.dev"
app_host: <%= ENV['RV_RENDEZVOUS_APP_HOST'] %>
# For login
google_api:
client_id: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com"
secret: "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
client_id: <%= ENV['RV_GOOGLE_API_CLIENT_ID'] %>
secret: <%= ENV['RV_GOOGLE_API_SECRET'] %>
# For file upload
s3:
access_key_id: "xxxxxxxxxxxxxxxxxxxxx"
secret_access_key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
bucket_name: "xxxxxxxxxxxxxxxxxx"
access_key_id: <%= ENV['RV_S3_ASSESS_KEY_ID'] %>
secret_access_key: <%= ENV['RV_S3_SECRET_ACCESS_KEY'] %>
bucket_name: <%= ENV['RV_S3_BACKET_NAME'] %>
# optional
# hipchat:
......@@ -28,7 +24,7 @@ defaults: &defaults
# google_analytics:
# optional
# pdf_uploading: false
pdf_uploading: <%= ENV['RV_PDF_UPLOADING'].present? %>
development:
<<: *defaults
......
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
timeout 15
preload_app true
before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
Process.kill 'QUIT', Process.pid
end
defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
end
after_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
end
defined?(ActiveRecord::Base) and
ActiveRecord::Base.establish_connection
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment