Browse Source

Adding preview environment

development
Godwin 10 years ago
parent
commit
d151e37e2e
  1. 2
      Gemfile
  2. 2
      app/helpers/application_helper.rb
  3. 3
      app/models/translation.rb
  4. 6
      config/assets_cdn.yml
  5. 2
      config/initializers/carrierwave.rb

2
Gemfile

@ -59,7 +59,7 @@ group :test do
gem 'database_cleaner'
end
group :staging, :production do
group :staging, :production, :preview do
gem 'rails_12factor'
gem 'capistrano'
gem 'rvm-capistrano'

2
app/helpers/application_helper.rb

@ -511,7 +511,7 @@ module ApplicationHelper
end
def is_production?
Rails.env == 'production'
Rails.env == 'production' || Rails.env == 'preview'
end
def is_test?

3
app/models/translation.rb

@ -1,3 +0,0 @@
class Translation < I18n::Backend::ActiveRecord::Translation
has_paper_trail
end

6
config/assets_cdn.yml

@ -2,6 +2,12 @@ development:
enabled: false
host: bikebike.org
preview:
enabled: true
host: preview-cdn.bikebike.org
protocol: https
fallback_protocol: http
production:
enabled: true
host: cdn.bikebike.org

2
config/initializers/carrierwave.rb

@ -1,5 +1,7 @@
CarrierWave.configure do |config|
if Rails.env == "production"
config.asset_host = "https://cdn.bikebike.org"
elsif Rails.env == "preview"
config.asset_host = "https://preview-cdn.bikebike.org"
end
end

Loading…
Cancel
Save