Skip to content

Commit

Permalink
initial deployment strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
Cody Fauser committed Sep 18, 2009
1 parent c261cbf commit 5b6936a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 29 deletions.
8 changes: 6 additions & 2 deletions Capfile
@@ -1,3 +1,7 @@
require 'capistrano/version'
#load 'deploy' if respond_to?(:namespace) # cap2 differentiator
load 'config/deploy'

Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }

load 'deploy'
load 'config/deploy'

24 changes: 18 additions & 6 deletions config/deploy.rb
@@ -1,19 +1,31 @@
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }

set :application, "opinion"
set :repository, "git@github.com:Shopify/opinion.git"
set :branch, "origin/master"
set :scm, :git
set :deploy_via, :fast_remote_cache
set :announce_in, "https://bot@jadedpixel.com:hallo28@jadedpixel.campfirenow.com/room/100257"
set :user, "deploy"
set :rails_env, "production"

role :app, "forums.cloud.shopify.com"
role :web, "forums.cloud.shopify.com"
role :db, "forums.cloud.shopify.com", :primary => true

desc "Signal Passenger to restart the application"
task :restart, :roles => :app do
run "touch #{release_path}/tmp/restart.txt"
namespace :gems do
task :install, :roles => :app do
run "cd #{release_path} && sudo rake RAILS_ENV=#{rails_env} gems:install"
end
end

namespace :deploy do
task :link_configs do
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
end

desc "Signal Passenger to restart the application"
task :restart, :roles => :app do
run "touch #{release_path}/tmp/restart.txt"
end
end

after "deploy:update_code", "deploy::migrate"
after "deploy:update_code", "deploy:link_configs", "gems:install", "deploy:migrate"
30 changes: 9 additions & 21 deletions config/environment.rb
Expand Up @@ -49,27 +49,15 @@

config.after_initialize do
SphinxModels = [Post]

HtmlEngine.default = [:textile, :whitelist_html, :autolink, :sanitize]
# Opinion supports the www.recaptcha.com captcha service. Sign up and provide a
# config/recaptcha.yml file with your private and public key information.
if File.exists?(Rails.root + "config/recaptcha.yml")
settings = YAML.load_file(Rails.root + "config/recaptcha.yml")[RAILS_ENV]
ReCaptcha.public_key, ReCaptcha.private_key = settings['public_key'], settings['private_key']
end
end
end

# Add new inflection rules using the following format
# (all these examples are active by default):
# Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end

HtmlEngine.default = [:textile, :whitelist_html, :autolink, :sanitize]

# Include your application configuration below
require 'dash_string'
Dir[RAILS_ROOT + '/lib/extensions/*.rb'].each { |file| require file }

# Opinion supports the www.recaptcha.com captcha service. Sign up and provide a
# config/recaptcha.yml file with your private and public key information.
if File.exists?(RAILS_ROOT + "/config/recaptcha.yml")
settings = YAML.load_file(RAILS_ROOT + "/config/recaptcha.yml")[RAILS_ENV]
ReCaptcha.public_key, ReCaptcha.private_key = settings['public_key'], settings['private_key']
end
require 'dash_string'

0 comments on commit 5b6936a

Please sign in to comment.