Permalink
Browse files

Merge branch 'chapter_14' into chapter_18

* chapter_14:
  Chapter 14
  Add pg gem for PostgreSQL on the server
  • Loading branch information...
2 parents 24c473f + 689c30b commit 7498e9d924473c16054965830b89c2106be1f6a7 @radar radar committed Oct 9, 2012
Showing with 94 additions and 0 deletions.
  1. +4 −0 Capfile
  2. +16 −0 bin/cap
  3. +16 −0 bin/capify
  4. +16 −0 bin/therubyracer
  5. +42 −0 config/deploy.rb
View
@@ -0,0 +1,4 @@
+load 'deploy'
+# Uncomment if you are using Rails' asset pipeline
+ # load 'deploy/assets'
+load 'config/deploy' # remove this line to skip loading any of the default tasks
View
16 bin/cap
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'cap' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('capistrano', 'cap')
View
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'capify' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('capistrano', 'capify')
View
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# This file was generated by Bundler.
+#
+# The application 'therubyracer' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('therubyracer', 'therubyracer')
View
@@ -0,0 +1,42 @@
+require 'bundler/capistrano'
+load 'deploy/assets'
+
+set :application, "ticketee"
+set :repository, "git@github.com:rails3book/ticketee-v2.git"
+
+set :scm, :git
+# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
+
+role :web, "14.ryanbigg.com" # Your HTTP server, Apache/etc
+role :app, "14.ryanbigg.com" # This may be the same as your `Web` server
+role :db, "14.ryanbigg.com", :primary => true # This is where Rails migrations will run
+
+set :user, "ticketeeapp.com"
+set :deploy_to, "/home/ticketeeapp.com/apps/#{application}"
+set :use_sudo, false
+set :keep_releases, 5
+
+default_run_options[:shell] = '/bin/bash --login'
+
+# if you want to clean up old releases on each deploy uncomment this:
+# after "deploy:restart", "deploy:cleanup"
+
+# if you're still using the script/reaper helper you will need
+# these http://github.com/rails/irs_process_scripts
+
+# If you are using Passenger mod_rails uncomment this:
+#
+namespace :deploy do
+ task :start do ; end
+ task :stop do ; end
+ task :restart, :roles => :app, :except => { :no_release => true } do
+ run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
+ end
+end
+
+task :symlink_database_yml do
+ run "rm #{release_path}/config/database.yml"
+ run "ln -sfn #{shared_path}/config/database.yml
+ #{release_path}/config/database.yml"
+end
+after "bundle:install", "symlink_database_yml"

0 comments on commit 7498e9d

Please sign in to comment.