/
deploy.rb
46 lines (33 loc) · 1.01 KB
/
deploy.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Automatic "bundle install" after deploy
require 'bundler/capistrano'
# Assets precompile
load 'deploy/assets'
# Application name
set :application, "global-trend-finder"
# BlueHost SSH user
set :user, "globapd6"
# App Domain
set :domain, "global-trend-finder.com"
# We don't need sudo on BlueHost
set :use_sudo, false
# git is our SCM
set :scm, :git
# gtf is our default git branch
set :branch, "gtf"
# Use local git repository
set :repository, "."
# Checkout, compress and send a local copy
set :deploy_via, :copy
set :deploy_to, "/home/#{user}/rails_apps/#{application}"
# We have all components of the app on the same server
server domain, :app, :web, :db, :primary => true
namespace :deploy do
task :start do ; end
task :stop do ; end
# Touch tmp/restart.txt to tell Phusion Passenger about new version
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{File.join(current_path, 'tmp', 'restart.txt')}"
end
end
# Clean-up old releases
after "deploy:restart", "deploy:cleanup"