Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/staging' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
joegatt committed Sep 21, 2013
2 parents c54dd9d + 9f99d7f commit 432aafa
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 32 deletions.
2 changes: 1 addition & 1 deletion app/views/application/_footer.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ footer
li = link_to link.gsub(/^([^\.]*).*$/, '\1').gsub(/plus/, '+').titlecase, "http://#{ link }"

li = link_to 'RSS feed', '/rss'
li = link_to 'joe@joegatt.net', 'mailto:joe@joegatt.net'
li = link_to Settings.contact.email, "mailto:#{ Settings.contact.email }"

small.copyright = t('site.copyright_html')
8 changes: 4 additions & 4 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
set :ssh_options, { :forward_agent => true }
set :normalize_asset_timestamps, false

set :repository, "git://github.com/joegattnet/joegattnet_v3.git"
set :repository, Settings.repository

set :user, "deployer"
set :group, "staff"
set :use_sudo, false

role :web, "joegatt.org"
role :app, "joegatt.org"
role :db, "joegatt.org", :primary => true
role :web, Settings.role_name
role :app, Settings.role_name
role :db, Settings.role_name, :primary => true

set(:latest_release) { fetch(:current_path) }
set(:release_path) { fetch(:current_path) }
Expand Down
10 changes: 5 additions & 5 deletions config/deploy/production.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
set :branch, "origin/master"
set :rails_env, "production"
set :deploy_to, "/home/deployer/apps/joegattnet_v3"
set :deploy_to, "/home/deployer/apps/#{ Settings.app_name }"

set :application, "joegattnet_v3"
set :application, Settings.app_name

default_environment["RAILS_ENV"] = 'production'

default_environment["PATH"] = "/usr/local/rvm/gems/ruby-2.0.0-p195@joegattnet_v3/bin:/usr/local/rvm/gems/ruby-2.0.0-p195@joegattnet_v3/bin:/usr/local/rvm/rubies/ruby-2.0.0-p195/bin:/usr/local/rvm/bin:$PATH"
default_environment["GEM_HOME"] = "/usr/local/rvm/gems/ruby-2.0.0-p195@joegattnet_v3"
default_environment["GEM_PATH"] = "/usr/local/rvm/gems/ruby-2.0.0-p195@joegattnet_v3:/usr/local/rvm/gems/ruby-2.0.0-p195@joegattnet_v3"
default_environment["PATH"] = "/usr/local/rvm/gems/ruby-2.0.0-p195@#{ Settings.app_name }/bin:/usr/local/rvm/gems/ruby-2.0.0-p195@#{ Settings.app_name }/bin:/usr/local/rvm/rubies/ruby-2.0.0-p195/bin:/usr/local/rvm/bin:$PATH"
default_environment["GEM_HOME"] = "/usr/local/rvm/gems/ruby-2.0.0-p195@#{ Settings.app_name }"
default_environment["GEM_PATH"] = "/usr/local/rvm/gems/ruby-2.0.0-p195@#{ Settings.app_name }:/usr/local/rvm/gems/ruby-2.0.0-p195@#{ Settings.app_name }"
default_environment["RUBY_VERSION"] = "ruby-2.0.0-p195"
10 changes: 5 additions & 5 deletions config/deploy/staging.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
set :branch, "origin/staging"
set :rails_env, "staging"
set :deploy_to, "/home/deployer/apps/joegattnet_v3_staging"
set :deploy_to, "/home/deployer/apps/#{ Settings.app_name }_staging"

set :application, "joegattnet_v3_staging"
set :application, "#{ Settings.app_name }_staging"

default_environment["RAILS_ENV"] = 'staging'

default_environment["PATH"] = "/usr/local/rvm/gems/ruby-2.0.0-p195@joegattnet_v3_staging/bin:/usr/local/rvm/gems/ruby-2.0.0-p195@joegattnet_v3_staging/bin:/usr/local/rvm/rubies/ruby-2.0.0-p195/bin:/usr/local/rvm/bin:$PATH"
default_environment["GEM_HOME"] = "/usr/local/rvm/gems/ruby-2.0.0-p195@joegattnet_v3_staging"
default_environment["GEM_PATH"] = "/usr/local/rvm/gems/ruby-2.0.0-p195@joegattnet_v3_staging:/usr/local/rvm/gems/ruby-2.0.0-p195@joegattnet_v3_staging"
default_environment["PATH"] = "/usr/local/rvm/gems/ruby-2.0.0-p195@#{ Settings.app_name }_staging/bin:/usr/local/rvm/gems/ruby-2.0.0-p195@#{ Settings.app_name }_staging/bin:/usr/local/rvm/rubies/ruby-2.0.0-p195/bin:/usr/local/rvm/bin:$PATH"
default_environment["GEM_HOME"] = "/usr/local/rvm/gems/ruby-2.0.0-p195@#{ Settings.app_name }_staging"
default_environment["GEM_PATH"] = "/usr/local/rvm/gems/ruby-2.0.0-p195@#{ Settings.app_name }_staging:/usr/local/rvm/gems/ruby-2.0.0-p195@#{ Settings.app_name }_staging"
default_environment["RUBY_VERSION"] = "ruby-2.0.0-p195"
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
config.cache_store = :mem_cache_store

# Enable serving of images, stylesheets, and JavaScripts from an asset server
config.action_controller.asset_host = 'http://a3.joegatt.org'
config.action_controller.asset_host = Settings.asset_host unless Settings.asset_host.blank?

# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
config.assets.precompile += %w( polyfills.js .svg .eot .woff .ttf )
Expand Down
2 changes: 1 addition & 1 deletion config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
config.cache_store = :mem_cache_store

# Enable serving of images, stylesheets, and JavaScripts from an asset server
config.action_controller.asset_host = 'http://a4.joegatt.org'
config.action_controller.asset_host = Settings.asset_host unless Settings.asset_host.blank?

# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
config.assets.precompile += %w( polyfills.js .svg .eot .woff .ttf )
Expand Down
12 changes: 10 additions & 2 deletions config/settings.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# All Nembrot settings go here except for secret strings

defaults: &defaults
version: '0.9'
locale: 'en'
version: 0.9
app_name: joegattnet_v3
role_name: joegatt.org
repository: git://github.com/joegattnet/joegattnet_v3.git
locale: en
admin:
name: Joe
email: joe@joegatt.net
monitoring:
name: Joe
email: monitoring@joegatt.net
contact:
name: Joe
email: joe@joegatt.net
mailer:
address: smtp.gmail.com
port: 587
Expand Down Expand Up @@ -211,6 +217,7 @@ test:
staging:
<<: *defaults
host: staging.joegatt.net
asset_host: http://a4.joegatt.org
evernote:
server: https://www.evernote.com
notebooks: 85d8c66d-f0ee-4c56-acac-e30ab88ce0ce
Expand All @@ -223,6 +230,7 @@ staging:
production:
<<: *defaults
host: joegatt.net
asset_host: http://a3.joegatt.org
evernote:
server: https://www.evernote.com
notebooks: 85d8c66d-f0ee-4c56-acac-e30ab88ce0ce
Expand Down
26 changes: 13 additions & 13 deletions config/unicorn.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Set environment to development unless something else is specified
env = ENV["RAILS_ENV"] || "development"
env = ENV['RAILS_ENV'] || 'development'

# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
Expand All @@ -12,34 +12,34 @@
timeout 30

# Production specific settings
if env == "production"
pid "/tmp/unicorn.joegattnet_v3.pid"
if env == 'production'
pid "/tmp/unicorn.#{ Settings.app_name }.pid"

# listen on both a Unix domain socket and a TCP port,
# we use a shorter backlog for quicker failover when busy
listen "/tmp/joegattnet_v3.socket", :backlog => 64
listen "/tmp/#{ Settings.app_name }.socket", :backlog => 64

# Help ensure your application will always spawn in the symlinked
# "current" directory that Capistrano sets up.
working_directory "/home/deployer/apps/joegattnet_v3/current"
working_directory "/home/deployer/apps/#{ Settings.app_name }/current"

# feel free to point this anywhere accessible on the filesystem
user 'deployer', 'staff'
shared_path = "/home/deployer/apps/joegattnet_v3/shared"
shared_path = "/home/deployer/apps/#{ Settings.app_name }/shared"

stderr_path "#{shared_path}/log/unicorn.stderr.log"
stdout_path "#{shared_path}/log/unicorn.stdout.log"
else
pid "/tmp/unicorn.joegattnet_v3_staging.pid"
pid "/tmp/unicorn.#{ Settings.app_name }_staging.pid"

# listen on both a Unix domain socket and a TCP port,
# we use a shorter backlog for quicker failover when busy
listen "/tmp/joegattnet_v3_staging.socket", :backlog => 64
listen "/tmp/#{ Settings.app_name }_staging.socket", :backlog => 64

# Staging
working_directory "/home/deployer/apps/joegattnet_v3_staging/current"
working_directory "/home/deployer/apps/#{ Settings.app_name }_staging/current"
user 'deployer', 'staff'
shared_path = "/home/deployer/apps/joegattnet_v3_staging/shared"
shared_path = "/home/deployer/apps/#{ Settings.app_name }_staging/shared"
stderr_path "#{shared_path}/log/unicorn.stderr.log"
stdout_path "#{shared_path}/log/unicorn.stdout.log"
end
Expand All @@ -53,10 +53,10 @@

# Before forking, kill the master process that belongs to the .oldbin PID.
# This enables 0 downtime deploys.
if env == "production"
old_pid = "/tmp/unicorn.joegattnet_v3.pid.oldbin"
if env == 'production'
old_pid = "/tmp/unicorn.#{ Settings.app_name }.pid.oldbin"
else
old_pid = "/tmp/unicorn.joegattnet_v3_staging.pid.oldbin"
old_pid = "/tmp/unicorn.#{ Settings.app_name }_staging.pid.oldbin"
end
if File.exists?(old_pid) && server.pid != old_pid
begin
Expand Down

0 comments on commit 432aafa

Please sign in to comment.