-
Notifications
You must be signed in to change notification settings - Fork 0
/
Capfile
57 lines (44 loc) · 1.2 KB
/
Capfile
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
47
48
49
50
51
52
53
54
55
56
57
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
#############
# CAPCONFIG #
#############
require 'yaml'
begin
capconfig = YAML.load_file("capconfig.yaml")
rescue
puts <<EOS
ERROR: Oops, capconfig.yaml seems to be missing or invalid!
Use `rake capconfig.yaml` to create it, then edit it to fill in your
deployment details.
EOS
exit 1
end
capconfig = {
:application => 'dixi',
:deploy_via => :remote_cache,
:branch => 'master',
}.merge(capconfig)
set :user, capconfig[:user]
set :domain, capconfig[:domain]
set :application, capconfig[:application]
set :repository, capconfig[:repository]
set :local_repository, capconfig[:local_repository]
set :deploy_to, capconfig[:deploy_to]
set :deploy_via, capconfig[:deploy_via]
set :scm, 'git'
set :branch, capconfig[:branch]
set :scm_verbose, true
set :use_sudo, false
server domain, :app, :web
namespace :deploy do
task :restart do
run "touch #{current_path}/tmp/restart.txt"
end
end
after :deploy do
run "ln -s #{shared_path}/contents #{release_path}/contents"
run "ln -s #{shared_path}/vendor #{release_path}/vendor"
run "cd #{release_path} && rake index"
end