-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRakefile
More file actions
65 lines (55 loc) · 1.51 KB
/
Copy pathRakefile
File metadata and controls
65 lines (55 loc) · 1.51 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
60
61
62
63
64
65
require "sinatra/activerecord/rake"
if ENV["SIMPLE_COV"] == "1"
require "simplecov"
SimpleCov.start do
add_filter "test/*"
add_filter "rakelib/*"
add_filter "config/*"
end
end
require_relative "config/environment"
task :configure => "configure:3rdparty"
task :configure => "configure:dependencies"
task :configure => "configure:directories"
task :configure => "configure:files"
task :configure => "db:migrate"
task :configure => "nginx:configure"
task :configure => "sshd:configure"
task :configure => "monit:configure"
task :configure => "redis:configure"
task :default => "test"
task :update do
# pull updated source
Sys.sys! "git", "stash"
Sys.sys! "git", "pull", "--rebase"
Sys.sys! "git", "stash", "pop"
Sys.sys! "bundle", "install"
Sys.sys! "rake", "db:migrate", "configure"
Sys.sys! "whenever", "--update-crontab"
end
namespace :run do
task :check do
ActiveRecord::Base.logger.level = Logger::INFO
while true do
sleep 1
# UI.success "check"
MetricSystem.count "check", 1
Tunnel.check do
SSHD.write_authorized_keys
end
Tunnel.ancient.destroy_all
end
end
end
desc "Start the pipe2me server"
task :start => "configure" do
system "monit -c monitrc && monit -c monitrc start all"
end
desc "Stop the pipe2me server"
task :stop do
system "monit -c monitrc stop all && monit -c monitrc quit"
end
desc "Restart the pipe2me server"
task :restart do
system "monit -c monitrc stop all && monit -c monitrc reload && monit -c monitrc start all"
end