forked from gerad/lazeroids-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Capfile
44 lines (35 loc) · 985 Bytes
/
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
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
default_run_options[:pty] = true
set :application, "lazeroids"
set :repository, "git://github.com/fortnightlabs/lazeroids.git"
set :scm, :git
set :user, "app"
role :app, "lazeroids"
namespace :deploy do
task :start, :roles => :app do
run "#{try_sudo} start lazeroids"
end
task :stop, :roles => :app do
run "#{try_sudo} stop lazeroids"
end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} restart lazeroids"
end
end
namespace :npm do
task :install, :roles => :app do
run "cd #{release_path} && /u/apps/.nodelocal/bin/npm install ."
end
end
after "deploy:update_code", "npm:install"
namespace :with_sudo do
task :on do
set :use_sudo, true
end
task :off do
set :use_sudo, false
end
end
before "deploy:setup", "with_sudo:off"
after "deploy:setup", "with_sudo:on"