Skip to content

Commit

Permalink
capifying and other deploy things
Browse files Browse the repository at this point in the history
  • Loading branch information
baccigalupi committed Feb 20, 2009
1 parent 303c1bf commit 68a7c0c
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 17 deletions.
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'
17 changes: 17 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require 'rubygems'

if File.directory?(gems_dir = File.join(Dir.pwd, 'gems'))
$BUNDLE = true
Gem.clear_paths
Gem.path.unshift(gems_dir)
end

require 'merb-core'

Merb::Config.setup(:merb_root => File.expand_path(File.dirname(__FILE__)),
:environment => ENV['RACK_ENV'])
Merb.environment = Merb::Config[:environment]
Merb.root = Merb::Config[:merb_root]
Merb::BootLoader.run

run Merb::Rack::Application.new
58 changes: 58 additions & 0 deletions config/deploy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
set :keep_releases, 5

# server user
set :user, "billtrack"
set :password, "B1ll***Tr@ck"
set :use_sudo, false
set :port, 2002
default_run_options[:pty] = true

# application
set :application, "billtrack.org"
set :deploy_to, "/home/#{user}/#{application}"

# database
set :database, "#{user}"
set :dbuser, user
set :dbpass, password

# repository
set :repository, "git@ruby_passenger:bill_track.git"
set :deploy_via, :remote_cache
set :scm, :git
set :branch, "master"
set :scm_verbose, true
set :scm_port, 2002

# IPs
role :app, "#{user}"
role :web, "#{user}"
role :db, "#{user}", :primary => true

desc "Link in shared things"
task :after_symlink do
# symlink log path
run "ln -nfs #{shared_path}/log #{release_path}/log"
# config/database
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
end

desc "Merb AR migration of database"
deploy.task :migrate, :roles => :app do
run "cd #{current_path}; bin/rake MERB_ENV=production db:migrate"
end


desc "Restart Application"
deploy.task :restart, :roles => :app do
run "cd #{current_path}; bin/thor merb:gem:redeploy"
run "touch #{current_path}/tmp/restart.txt"
end

namespace :merb do
desc "Redeploy Gems"
task :redeploy_gems do
run "cd #{current_path}; bin/thor merb:gem:redeploy"
end
end

17 changes: 0 additions & 17 deletions public/.htaccess

This file was deleted.

0 comments on commit 68a7c0c

Please sign in to comment.