Skip to content

Instantly share code, notes, and snippets.

@ouyangzhiping
Created June 13, 2011 14:02
Show Gist options
  • Save ouyangzhiping/1022819 to your computer and use it in GitHub Desktop.
Save ouyangzhiping/1022819 to your computer and use it in GitHub Desktop.
cap分发参考文档
set :application, "forum_demo"
set :domain, "tech.yangzhiping.com"
set :repository, "git@github.com:cngithub/xdite.git"
set :deploy_to, "/home/apps/forum_demo"
role :app, domain
role :web, domain
role :db, domain, :primary => true
set :deploy_via, :remote_cache
set :deploy_env, "production"
set :rails_env, "production"
set :scm, :git
set :scm_passphrase, "p00p"
set :branch, 'master'
set :deploy_via, :copy
set :scm_verbose, true
set :use_sudo, false
set :user, "apps"
set :group, "apps"
default_environment["PATH"] = "/opt/ree/bin:/usr/local/bin:/usr/bin:/bin:/usr/games"
namespace :deploy do
desc "restart"
task :restart do
run "touch #{current_path}/tmp/restart.txt"
end
end
desc "Create database.yml and asset packages for production"
after("deploy:update_code") do
db_config = "#{shared_path}/config/database.yml.production"
run "cp #{db_config} #{release_path}/config/database.yml"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment