-
Notifications
You must be signed in to change notification settings - Fork 2
/
Capfile
75 lines (62 loc) · 1.86 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
load 'deploy'
set :stages, %w(demo staging production)
set :default_stage, "staging"
require 'capistrano/ext/multistage'
set :user, 'utah'
set :application, 'risingtide'
# domain is set in config/deploy/{stage}.rb
# file paths
set :repository, "[email protected]:utahstreetlabs/risingtide.git"
set(:deploy_to) { "/home/#{user}/#{application}" }
# one server plays all roles
role :app do
fetch(:domain)
end
set :deploy_via, :remote_cache
set :scm, 'git'
set :scm_verbose, true
set(:branch) do
case stage
when :production then "production"
else "staging"
end
end
set :use_sudo, false
set :hipchat_token, '39019837fa847cfb17282ed5d3fbce'
set :hipchat_room_name, 'bots'
set :hipchat_announce, true
# total number of workers
set(:workers) do
case stage
when :production then 10
else 4
end
end
# whether or not topology debug mode should be enabled
# see https://github.com/nathanmarz/storm/blob/master/src/jvm/backtype/storm/Config.java
set(:storm_debug) do
case stage
when :production then 'false'
else 'true'
end
end
after "deploy", "deploy:cleanup"
namespace :deploy do
task :build_uberjar do
run "cd #{current_path} && bin/lein clean && bin/lein compile && bin/lein uberjar"
end
before "deploy:restart", "deploy:build_uberjar"
task :start, :roles => :app, :except => { :no_release => true } do
run "RISINGTIDE_ENV=#{stage} storm/current/bin/storm jar risingtide/current/target/risingtide-*-standalone.jar risingtide.storm.FeedTopology workers #{workers} debug #{storm_debug}"
end
task :stop, :roles => :app, :except => { :no_release => true } do
run "storm/current/bin/storm kill 'feed topology'; true"
end
task :restart, :roles => :app, :except => { :no_release => true } do
stop
# wait maximum amount of time for topology to stop
# should match topology.message.timeout.secs in topology config
sleep 60
start
end
end