This repository was archived by the owner on Dec 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathRakefile
More file actions
52 lines (35 loc) · 1.3 KB
/
Rakefile
File metadata and controls
52 lines (35 loc) · 1.3 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
task :enrich do
require 'fusion'
modes = {"pretty-bundles" => Fusion::Quick, "optimized-bundles" => Fusion::Optimized}
# The old pretty mode would remove comments and auto-indent ... I should add that to fusion
modes.each do |bundle_name, compiler|
puts "Building (#{bundle_name})"
bundles = File.join(File.expand_path("."),"build/#{bundle_name}.yml")
Fusion::configure({:bundle_file_path => bundles})
this_compiler = compiler.new
this_compiler.run
end
end
task :upload => [:enrich] do
require 'manhattan_uploader'
require 'rdiscount'
require 'erb'
version = File.read("VERSION").strip
if File.exists? "JENKINS"
version += "."
version += File.read("JENKINS").strip
end
buildf = File.open("BUILD_VERSION", 'w')
buildf.puts version
buildf.close
urls = ManhattanUploader.run(File.expand_path("."), "build/src", false)
urls.first =~ /(\d+\.\d+\.\d+)/
raise Exception.new("Could not extract version from url : (#{urls.first})") if $1.nil?
version = $1
latest_page = File.open("build/latest.md.erb").read
md = ERB.new(latest_page).result(binding)
latest_page = RDiscount.new(md).to_html
url = ManhattanUploader.upload_file("uranium/latest.html", latest_page)
puts "Uploaded latest page: #{url[:s3]}"
end
task :default => [:enrich]