forked from MyPureCloud/developer-center-blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rakefile
43 lines (35 loc) · 1.06 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
require 'json'
task :default do
status = system("bundle exec middleman build")
indexFiles = Dir.glob("localBuild/**/*").map { |x| x.sub('localBuild/', '') }.select do |file|
file.include?("html") && !file.include?('stylesheets') && !file.include?('vendor')
end
manifest = {
"name"=> "developercenter-blog",
"version"=> "",
"buildNumber"=> "",
"indexFiles"=> []
}
if ENV['BUILD_NUMBER'] != nil
manifest["version"] = ENV['BUILD_NUMBER'].to_s
manifest["buildNumber"] = ENV['BUILD_NUMBER'].to_s
end
indexFiles.each do |file|
manifest["indexFiles"].push( {
"file" => file
})
end
manifest["indexFiles"].push({
"file"=> "blog/atom.xml"
})
manifest["indexFiles"].push({
"file"=> "blog/cdn.json"
})
manifest["indexFiles"].push({
"file"=> "blog/icon.png"
})
manifest["indexFiles"].push({
"file"=> "blog/image.png"
})
File.open("localBuild/manifest.json", 'w') { |file| file.write(manifest.to_json) }
end