-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCapfile
More file actions
59 lines (46 loc) · 1.42 KB
/
Copy pathCapfile
File metadata and controls
59 lines (46 loc) · 1.42 KB
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
load 'deploy' if respond_to?(:namespace)
default_run_options[:pty] = true # Must be set for the password prompt
# from git to work
set :application, "semantification"
# use local repo
# set :repository, "."
set :repository, "https://github.com/theefer/semantification.git"
set :scm, "git"
set :deploy_via, :remote_cache
# set :deploy_to, "/var/www"
set :deploy_to, "/mnt/#{application}"
set :location, "ec2-54-247-28-203.eu-west-1.compute.amazonaws.com"
role :app, location
role :web, location
role :db, location, :primary => true
set :user, "ec2-user"
# stolen from:
# http://pemberthy.blogspot.co.uk/2009/02/deploying-sinatra-applications-with.html
namespace :deploy do
task :start, :roles => [:web, :app] do
run "cd #{deploy_to}/current && nohup thin -C conf/thin_prod.yml -R config.ru start"
end
task :stop, :roles => [:web, :app] do
run "cd #{deploy_to}/current && nohup thin -C conf/thin_prod.yml -R config.ru stop"
end
task :restart, :roles => [:web, :app] do
deploy.stop
deploy.start
end
# This will make sure that Capistrano doesn't try to run rake:migrate (this is not a Rails project!)
task :cold do
deploy.update
deploy.start
end
end
namespace :nginx do
task :start do
run "sudo /etc/init.d/nginx start"
end
task :stop do
run "sudo /etc/init.d/nginx stop"
end
task :restart do
run "sudo /etc/init.d/nginx restart"
end
end