From 3bcc59a4bdb1841a6d979c416649694bf9a2a479 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Wed, 18 Feb 2009 10:42:35 +0000 Subject: [PATCH] Minor Capistrano tweaks --- Capfile | 3 +++ config/deploy.rb | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 Capfile create mode 100644 config/deploy.rb diff --git a/Capfile b/Capfile new file mode 100644 index 0000000..c36d48d --- /dev/null +++ b/Capfile @@ -0,0 +1,3 @@ +load 'deploy' if respond_to?(:namespace) # cap2 differentiator +Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } +load 'config/deploy' \ No newline at end of file diff --git a/config/deploy.rb b/config/deploy.rb new file mode 100644 index 0000000..455718d --- /dev/null +++ b/config/deploy.rb @@ -0,0 +1,39 @@ +set :application, "depot" +set :repository, "http://scripts.njae.me.uk/svn/m8rails/#{application}/branches/stable" + +# If you aren't deploying to /u/apps/#{application} on the target +# servers (which is the default), you can specify the actual location +# via the :deploy_to variable: +set :deploy_to, "/var/www/depot.njae.me.uk/" + +# If you aren't using Subversion to manage your source code, specify +# your SCM below: +set :scm, :subversion +set :scm_username, 'neil' + +role :app, "depot.njae.me.uk" +role :web, "depot.njae.me.uk" +role :db, "depot.njae.me.uk", :primary => true + +# Have the spinner/spawner/reaper processes run as the default user +set :runner, nil + +# Copy the database.yml file across, as it's not kept in the SVN repository +after "deploy:update_code" , :configure_database +desc "copy database.yml into the current release path" +task :configure_database, :roles => :app do + db_config = "#{deploy_to}/config/database.yml" + run "cp #{db_config} #{release_path}/config/database.yml" +end + +# Define the user for running and stopping server sub-proceses (Mongrel, etc.) +# set :runner, :user + +# As we're not running any other server processes (FastCGI, Mongrel, etc.), +# we don't need to start and stop them. +namespace :deploy do + [:start, :stop, :restart].each do |t| + desc "#{t} task is a no-op with mod_rails" + task t, :roles => :app do ; end + end +end \ No newline at end of file -- 2.34.1