Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set up Capistrano for deployment

  • Loading branch information...
commit ab54b3d16df9a3bb1b1ee080208a8655843e7e89 1 parent bc191f1
@konklone konklone authored
Showing with 47 additions and 0 deletions.
  1. +4 −0 Capfile
  2. +43 −0 config/deploy.rb
View
4 Capfile
@@ -0,0 +1,4 @@
+load 'deploy' if respond_to?(:namespace) # cap2 differentiator
+Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
+
+load 'config/deploy' # remove this line to skip loading any of the default tasks
View
43 config/deploy.rb
@@ -0,0 +1,43 @@
+set :environment, :production
+
+set :user, 'klondike'
+set :application, 'ohnomymoney'
+
+set :deploy_to, "/home/#{user}/ohnomymoney.com"
+set :domain, 'ohnomymoney.com'
+
+set :scm, :git
+set :repository, "git://github.com/klondike/#{application}.git"
+set :branch, 'master'
+
+set :deploy_via, :remote_cache
+set :runner, user
+set :admin_runner, runner
+
+role :app, domain
+role :web, domain
+
+set :use_sudo, false
+after "deploy", "deploy:cleanup"
+after "deploy:update_code", "deploy:shared_links"
+
+namespace :deploy do
+ task :start do ; end
+ task :stop do ; end
+ task :migrate do; end
+
+ desc "Restart the server"
+ task :restart, :roles => :app, :except => { :no_release => true } do
+ run "touch #{File.join current_path, 'tmp', 'restart.txt'}"
+ end
+
+ desc "Get shared files into position"
+ task :shared_links, :roles => [:web, :app] do
+ run "ln -nfs #{shared_path}/database.yml #{release_path}/config/database.yml"
+ run "ln -nfs #{shared_path}/buxfer.yml #{release_path}/updater/buxfer.yml"
+ run "ln -nfs #{shared_path}/dreamhost.rb #{release_path}/dreamhost.rb"
+ run "rm #{File.join release_path, 'tmp', 'pids'}"
+ run "rm #{File.join release_path, 'public', 'system'}"
+ run "rm #{File.join release_path, 'log'}"
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.