-
Notifications
You must be signed in to change notification settings - Fork 282
/
Copy pathRakefile
80 lines (68 loc) · 1.48 KB
/
Rakefile
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
78
79
80
def thread_pool
@thread_pool ||= ThreadPool.new options.thread_pool_size
end
def pipe(command)
output = ''
IO.popen(command) do |io|
until io.eof?
buffer = io.gets
output << buffer
puts buffer
end
end
output
end
task default: :serve
namespace :academy do
task :puma do
Dir.chdir 'Archive' do
Dir.chdir 'academy' do
puts `bundle exec puma -t 8:32 -p 5000`
end
end
end
task :serve do
pipe 'cd Archive && cd academy && bundle exec jekyll s -q --skip-initial-build --port 5000'
end
end
namespace :documentation do
task :puma do
Dir.chdir 'Archive' do
Dir.chdir 'documentation' do
puts `bundle exec puma -t 8:32 -p 5004`
end
end
end
task :serve do
pipe 'cd Archive && cd documentation && bundle exec jekyll s -q --skip-initial-build --port 5004'
end
end
namespace :docs do
task :index do
if ENV["SITE_URL"] == 'https://www.braze.com' && ENV["RACK_ENV"] == 'production'
puts `bundle exec jekyll algolia`
end
end
task :build do
puts `bundle exec jekyll build`
end
task puma: [:build,:index] do
puts `bundle exec puma -t 8:32 -p 5006`
end
task :serve do
pipe 'bundle exec jekyll s --port 5006'
end
end
namespace :success do
task :serve do
pipe 'bundle exec ruby proxy.rb'
end
end
namespace :assets do
task :precompile do
print 'no-op'
end
end
multitask serve: [
'academy:serve', 'documentation:serve', 'docs:serve', 'success:serve'
]