forked from finscn/avoscloud-doc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
32 lines (28 loc) · 1.08 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
def exec(cmd)
puts cmd
system cmd
end
task :check_ruby_version do |t|
raise "Ruby < 1.9" if RUBY_VERSION.include? "1.8"
end
task :render => [:check_ruby_version] do |t|
exec 'ruby render.rb'
end
task :deploy, [:type] => [] do |t, args|
case args[:type]
when "us-w1"
exec "fab -H ubuntu@us-w1-app1.leancloud.cn,ubuntu@us-w1-app2.leancloud.cn deploy_docs:target=us"
when "cn-n1"
exec "fab -H ubuntu@web1.avoscloud.com,ubuntu@web2.avoscloud.com,ubuntu@web3.avoscloud.com,ubuntu@web4.avoscloud.com,ubuntu@web5.avoscloud.com,ubuntu@web6.avoscloud.com,ubuntu@web7.avoscloud.com,ubuntu@web8.avoscloud.com deploy_docs"
when "cn-e1"
exec "fab -H ubuntu@cn-e1-web1,ubuntu@cn-e1-web2,ubuntu@cn-e1-web3 deploy_docs"
when "beta"
exec "fab -H ubuntu@tsdb2.avoscloud.com deploy_docs"
when "cn_stg"
exec "fab -H ubuntu@cn-stg1.avoscloud.com deploy_docs"
end
end
task :install do |t|
# exec "gem list | grep -E 'hpricot.*0\.8\.6' > /dev/null || sudo gem install hpricot"
# exec "npm list -g | grep -E 'doctoc@0\.4\.4' > /dev/null || sudo npm install -g doctoc@0.4.4"
end