-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathRakefile.rb
33 lines (26 loc) · 966 Bytes
/
Rakefile.rb
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
require 'yaml'
require 'aws/s3'
require "active_support"
task :xpi do
`rm -rf tmp/xpi`
`mkdir -p tmp/xpi`
`cp -r extension/. tmp/xpi`
build = "0.1.#{Time.now.to_i}"
`cd tmp/xpi && sed -i 's/BUILD/#{build}/g' *.rdf`
`cd tmp/xpi && find chrome components chrome.manifest modules install.rdf | egrep -v "(~|#|\.git|\.idl)" | xargs zip firenomics.xpi`
puts "Built version #{build}"
end
task :release => :xpi do
begin
keys = YAML::load_file("s3.yml")['connection'].symbolize_keys
rescue
raise "Could not load AWS s3.yml"
end
AWS::S3::Base.establish_connection!(keys)
[{:file => 'tmp/xpi/firenomics.xpi', :content_type => 'application/x-xpinstall'},
{:file => 'tmp/xpi/update.rdf', :content_type => 'text/xml'}].each do |f|
AWS::S3::S3Object.store(File.basename(f[:file]), open(f[:file]), 'firenomics', :access => "public-read", :content_type => f[:content_type])
end
puts "Uploaded to S3"
end
task :default => :release