forked from vanilla/vanilla
-
Notifications
You must be signed in to change notification settings - Fork 3
/
capfile
77 lines (62 loc) · 2.03 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
##########
# This capfile is intended for use by our CI server!
#
# DO NOT USE MANUALLY
##########
load 'deploy'
# Basic settings
set :application, "kohana-forums"
set :repository, "."
set :scm, :none
set :deploy_via, :copy
set :copy_dir, "/tmp/#{application}/"
set :user, "www-forum.kohanaframework.org"
set :runner, "www-forum.kohanaframework.org"
set :use_sudo, false
# Stages
task :production do
role :app, "forum.kohanaframework.org"
role :db, "forum.kohanaframework.org", {:primary=>true}
role :web, "forum.kohanaframework.org"
set :deploy_to, "/home/www-forum.kohanaframework.org"
end
# Workaround a cap bug..
Dir.mkdir("/tmp/#{application}/") unless File.directory?("/tmp/#{application}/")
# Hooks
before "deploy:setup", "vanilla:before_setup"
after "deploy:finalize_update", "vanilla:finalize_update"
after "deploy:migrate", "vanilla:migrate"
# Vanilla specific deployment ..
namespace :vanilla do
task :before_setup, :except => { :no_release => true } do
shared_children.push("uploads")
shared_children.push("conf")
end
task :finalize_update, :except => { :no_release => true } do
#run "rm -rf #{latest_release}/conf"
run "ln -s #{shared_path}/conf/config.php #{latest_release}/conf/config.php"
run "rm -rf #{latest_release}/uploads"
run "ln -s #{shared_path}/uploads #{latest_release}/uploads"
end
task :migrate, :roles => :db, :only => { :primary => true } do
run "curl -I --silent http://forum.kohanaframework.org/utility/update | grep HTTP | cut -d' ' -f2"
end
end
# Override some defaults..
namespace :deploy do
task :finalize_update, :except => { :no_release => true } do
run "chmod -R g+w #{latest_release}" if fetch(:group_writable, true)
end
task :restart, :roles => :app, :except => { :no_release => true } do
sudo "service php5-fpm restart"
end
task :start, :roles => :app, :except => { :no_release => true } do
# do nothing
end
task :stop, :roles => :app, :except => { :no_release => true } do
# do nothing
end
task :migrate, :roles => :db, :only => { :primary => true } do
# do nothing
end
end