forked from mhansen/nzwirelessmap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rakefile
29 lines (24 loc) · 1.16 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
file "prism.zip" do |t|
sh "wget http://www.rsm.govt.nz/online-services-resources/pdf-and-documents-library/tools/spectrum-search-lite/prism.zip"
end
file "prism.mdb" => ["prism.zip"] do |t|
sh "unzip prism.zip"
end
file "prism.sqlite3" => ["prism.mdb"] do |t|
sh "rm -f #{t.name}"
sh "java -jar lib/mdb-sqlite.jar #{t.prerequisites[0]} #{t.name}"
# by default, the generated database has no idea what it looks like, so it
# makes all kinds of bad decisions when planning queries. We ask the database
# to analyze itself, so it can make an informed decision about how to do
# massive JOINs.
sh "echo 'analyze main;' | sqlite3 #{t.name}"
end
file "point_to_point_links.csv" => ["prism.sqlite3", "select_point_to_point_links.sql"] do |t|
sh "cat select_point_to_point_links.sql | sqlite3 prism.sqlite3 > #{t.name}"
end
task "update_fusion_tables", [:refresh_token] => ["point_to_point_links.csv", "fusiontables.py"] do |t, args|
sh "cat #{t.prerequisites[0]} | python #{t.prerequisites[1]} --refresh_token=#{args.refresh_token}"
end
task "deploy_to_app_engine" => ["site/static/index.js"] do
sh "~/Downloads/google_appengine/appcfg.py update site2/ --oauth2"
end