Commit 021a2f01269817453155248379d0a0967ed910ad
1 parent
dccfff36
Exists in
master
and in
1 other branch
Move deploy file to deploy.example.rb and add some info for copying it over.
Showing
3 changed files
with
54 additions
and
47 deletions
Show diff stats
.gitignore
| @@ -0,0 +1,53 @@ | @@ -0,0 +1,53 @@ | ||
| 1 | +# Deploy Config | ||
| 2 | +# ============= | ||
| 3 | +# | ||
| 4 | +# Copy this file to config/deploy.rb and customize it as needed. | ||
| 5 | +# Then run `cap deploy:setup` to set up your server and finally | ||
| 6 | +# `cap deploy` whenever you would like to deploy Errbit. Refer | ||
| 7 | +# to the Readme for more information. | ||
| 8 | + | ||
| 9 | +set :application, "errbit" | ||
| 10 | +set :repository, "http://github.com/jdpace/errbit.git" | ||
| 11 | + | ||
| 12 | +role :web, "errbit.example.com" | ||
| 13 | +role :app, "errbit.example.com" | ||
| 14 | +role :db, "errbit.example.com", :primary => true | ||
| 15 | + | ||
| 16 | +set :user, :deploy | ||
| 17 | +set :use_sudo, false | ||
| 18 | +set :ssh_options, { :forward_agent => true } | ||
| 19 | +default_run_options[:pty] = true | ||
| 20 | + | ||
| 21 | +set :deploy_to, "/var/www/apps/#{application}" | ||
| 22 | +set :deploy_via, :remote_cache | ||
| 23 | +set :copy_cache, true | ||
| 24 | +set :copy_exclude, [".git"] | ||
| 25 | +set :copy_compression, :bz2 | ||
| 26 | + | ||
| 27 | +set :scm, :git | ||
| 28 | +set :scm_verbose, true | ||
| 29 | +set(:current_branch) { `git branch`.match(/\* (\S+)\s/m)[1] || raise("Couldn't determine current branch") } | ||
| 30 | +set :branch, defer { current_branch } | ||
| 31 | + | ||
| 32 | +after 'deploy:update_code', 'bundler:install' | ||
| 33 | + | ||
| 34 | +namespace :deploy do | ||
| 35 | + task :start do ; end | ||
| 36 | + task :stop do ; end | ||
| 37 | + task :restart, :roles => :app, :except => { :no_release => true } do | ||
| 38 | + run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" | ||
| 39 | + end | ||
| 40 | +end | ||
| 41 | + | ||
| 42 | +namespace :bundler do | ||
| 43 | + task :symlink_vendor, :roles => :app, :except => { :no_release => true } do | ||
| 44 | + shared_gems = File.join(shared_path,'vendor','bundler_gems') | ||
| 45 | + release_gems = "#{latest_release}/vendor/" | ||
| 46 | + run("mkdir -p #{shared_gems} && ln -nfs #{shared_gems} #{release_gems}") | ||
| 47 | + end | ||
| 48 | + | ||
| 49 | + task :install, :rolse => :app do | ||
| 50 | + bundler.symlink_vendor | ||
| 51 | + run("cd #{release_path} && bundle install vendor/bundler_gems --without development test") | ||
| 52 | + end | ||
| 53 | +end | ||
| 0 | \ No newline at end of file | 54 | \ No newline at end of file |
config/deploy.rb
| @@ -1,47 +0,0 @@ | @@ -1,47 +0,0 @@ | ||
| 1 | -require 'config/environment' | ||
| 2 | - | ||
| 3 | -set :application, "errbit" | ||
| 4 | -set :repository, "http://github.com/jdpace/errbit.git" | ||
| 5 | - | ||
| 6 | -set :scm, :git | ||
| 7 | -set :scm_verbose, true | ||
| 8 | -set(:current_branch) { `git branch`.match(/\* (\S+)\s/m)[1] || raise("Couldn't determine current branch") } | ||
| 9 | -set :branch, defer { current_branch } | ||
| 10 | - | ||
| 11 | -set :user, :deploy | ||
| 12 | -set :use_sudo, false | ||
| 13 | -set :ssh_options, { :forward_agent => true } | ||
| 14 | -default_run_options[:pty] = true | ||
| 15 | - | ||
| 16 | -set :deploy_to, "/var/www/apps/#{application}" | ||
| 17 | -set :deploy_via, :remote_cache | ||
| 18 | -set :copy_cache, true | ||
| 19 | -set :copy_exclude, [".git"] | ||
| 20 | -set :copy_compression, :bz2 | ||
| 21 | - | ||
| 22 | -role :web, Errbit::Config.host | ||
| 23 | -role :app, Errbit::Config.host | ||
| 24 | -role :db, Errbit::Config.host, :primary => true | ||
| 25 | - | ||
| 26 | -after 'deploy:update_code', 'bundler:install' | ||
| 27 | - | ||
| 28 | -namespace :deploy do | ||
| 29 | - task :start do ; end | ||
| 30 | - task :stop do ; end | ||
| 31 | - task :restart, :roles => :app, :except => { :no_release => true } do | ||
| 32 | - run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" | ||
| 33 | - end | ||
| 34 | -end | ||
| 35 | - | ||
| 36 | -namespace :bundler do | ||
| 37 | - task :symlink_vendor, :roles => :app, :except => { :no_release => true } do | ||
| 38 | - shared_gems = File.join(shared_path,'vendor','bundler_gems') | ||
| 39 | - release_gems = "#{latest_release}/vendor/" | ||
| 40 | - run("mkdir -p #{shared_gems} && ln -nfs #{shared_gems} #{release_gems}") | ||
| 41 | - end | ||
| 42 | - | ||
| 43 | - task :install, :rolse => :app do | ||
| 44 | - bundler.symlink_vendor | ||
| 45 | - run("cd #{release_path} && bundle install vendor/bundler_gems --without development test") | ||
| 46 | - end | ||
| 47 | -end | ||
| 48 | \ No newline at end of file | 0 | \ No newline at end of file |