Skip to content

Commit

Permalink
add capistrano stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
twinge committed Jan 27, 2009
1 parent d2eb586 commit c6851de
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ config/amazon_s3.yml
.DS_Store
doc/api
coverage
config/deploy.rb
public/imports
public/javascripts/all.js
public/stylesheets/all.css
Expand Down
3 changes: 3 additions & 0 deletions Capfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'
1 change: 0 additions & 1 deletion app/views/users/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<tr><td class="right_text">Last Name</td> <td><%= f.text_field(:last, :size => 40) %></td></tr>
<tr><td class="right_text">Email</td> <td><%= f.text_field(:email, :size => 40) %></td></tr>
<tr><td class="right_text">Bio</td> <td><%= f.text_area(:bio, :cols => 41, :rows => 3) %></td></tr>

<tr><td class="right_text">Skill keywords</td> <td><%= f.text_field(:skillkeywords, :size => 40) %></td></tr>
<tr>
<td class="right_text" style="padding-top:4px">Active membership?</td>
Expand Down
66 changes: 66 additions & 0 deletions config/deploy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
set :application, "globaltechdev.org"
set :repository, "git://github.com/andrewroth/gtd-rails.git"

# 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/#{application}"

# If you aren't using Subversion to manage your source code, specify
# your SCM below:
default_run_options[:pty] = true
set :scm, "git"
set :branch, "master"
set :deploy_via, :remote_cache
set :git_enable_submodules, 1
ssh_options[:forward_agent] = true
ssh_options[:port] = 40022

set :use_sudo, false

role :app, "gtd.ministryhacks.com"
role :web, "gtd.ministryhacks.com"
role :db, "gtd.ministryhacks.com", :primary => true
set :deploy_to, "/var/www/globaltechdev.org"


# define the restart task
desc "Restart the web server"
deploy.task :restart, :roles => :app do
run "touch #{deploy_to}/current/tmp/restart.txt"
end

desc "Add linked files after deploy and set permissions"
task :after_update_code, :roles => :app do
run "ln -s #{shared_path}/config/database.yml #{release_path}/config/database.yml"
run "ln -s #{shared_path}/config/amazon_s3.yml #{release_path}/config/amazon_s3.yml"
# expires symlink for apache expires headers
run "ln -s #{release_path}/public #{release_path}/public/expires"

# create the tmp folders
run "mkdir -p -m 770 #{shared_path}/tmp/{cache,sessions,sockets,pids}"
run "rm -Rf #{release_path}/tmp"
run "ln -s #{shared_path}/tmp #{release_path}/tmp"
end

# You can use "transaction" to indicate that if any of the tasks within it fail,
# all should be rolled back (for each task that specifies an on_rollback
# handler).

desc "A task demonstrating the use of transactions."
task :long_deploy do
transaction do
deploy.update_code
# deploy.disable_web
deploy.symlink
deploy.migrate
end

deploy.restart
# deploy.enable_web
end

desc "Automatically run cleanup"
task :after_deploy, :roles => :app do
deploy.cleanup
end

0 comments on commit c6851de

Please sign in to comment.