forked from choria-io/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
61 lines (48 loc) · 1.64 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
desc "Build website"
task :build_docs do
Dir.chdir(File.dirname(__FILE__)) do
sh("rm -rf out docs_template")
sh("mkdir -p out/docs")
sh("cp -r docs docs_template")
end
Dir.chdir(File.join(File.dirname(__FILE__), "landing")) do
sh("hugo -b %s/ -d ../out/" % ENV["CHORIA_SITE_NAME"])
end
Dir.chdir(File.join(File.dirname(__FILE__), "docs")) do
sh("hugo -b %s/docs/ -d ../out/docs/" % ENV["CHORIA_SITE_NAME"])
end
Dir.chdir(File.join(File.dirname(__FILE__), "blog")) do
if ENV["CHORIA_BLOG_DRAFTS"]
sh("hugo -b %s/blog/ -DF -d ../out/blog/" % ENV["CHORIA_SITE_NAME"])
else
sh("hugo -b %s/blog/ -d ../out/blog/" % ENV["CHORIA_SITE_NAME"])
end
end
Dir.chdir(File.join(File.dirname(__FILE__), "out")) do
rm("apple-touch-icon.png")
end
end
desc "Build and Publish the production website"
task :publish_prod_docs do
ENV["CHORIA_SITE_NAME"] = "https://choria.io"
Rake::Task[:build_docs].invoke
Dir.chdir(File.join(File.dirname(__FILE__), "out")) do
sh("netlify deploy -s 39463be8-021a-4db4-ad07-709104da884a -p -d .")
end
end
desc "Build and Publish the preview website"
task :publish_docs do
ENV["CHORIA_SITE_NAME"] = "https://master.choria.io"
ENV["CHORIA_BLOG_DRAFTS"] = "1"
Rake::Task[:build_docs].invoke
Dir.chdir(File.join(File.dirname(__FILE__), "out")) do
sh("netlify deploy -s e293fe95-122a-4b0a-ae62-c74fa588ab8d -p -d .")
end
end
desc "Build for local consumption "
task :publish_local_docs do
ENV["CHORIA_SITE_NAME"] = "http://localhost:8080" % Dir.pwd
ENV["CHORIA_BLOG_DRAFTS"] = "1"
Rake::Task[:build_docs].invoke
puts "execute: ruby -run -e httpd -- out"
end