store objects in s3, list them in readme

This commit is contained in:
David Dollar
2011-09-12 11:11:36 -04:00
parent f358d897fa
commit c948858f45
4 changed files with 23 additions and 5 deletions

View File

@@ -10,5 +10,6 @@ group :development do
gem 'rcov', '~> 0.9.8'
gem 'rr', '~> 1.0.2'
gem 'rspec', '~> 2.6.0'
gem 'aws-s3'
gem "rubyzip"
end

View File

@@ -8,6 +8,11 @@ PATH
GEM
remote: http://rubygems.org/
specs:
aws-s3 (0.6.2)
builder
mime-types
xml-simple
builder (3.0.0)
crack (0.1.8)
diff-lcs (1.1.2)
fakefs (0.2.1)
@@ -39,11 +44,13 @@ GEM
rubyzip (0.9.4)
term-ansicolor (1.0.6)
thor (0.14.6)
xml-simple (1.0.15)
PLATFORMS
ruby
DEPENDENCIES
aws-s3
fakefs (~> 0.2.1)
foreman!
parka

View File

@@ -2,8 +2,18 @@
## Installation
* Rubygems
gem install foreman
* OSX
http://assets.foreman.io/foreman/foreman.pkg
* Standalone Tarball
http://assets.foreman.io/foreman/foreman.tgz
## Description
http://blog.daviddollar.org/2011/05/06/introducing-foreman.html

View File

@@ -131,20 +131,20 @@ def s3_connect
require "aws/s3"
unless ENV["HEROKU_RELEASE_ACCESS"] && ENV["HEROKU_RELEASE_SECRET"]
puts "please set HEROKU_RELEASE_ACCESS and HEROKU_RELEASE_SECRET in your environment"
unless ENV["DAVID_RELEASE_ACCESS"] && ENV["DAVID_RELEASE_SECRET"]
puts "please set DAVID_RELEASE_ACCESS and DAVID_RELEASE_SECRET in your environment"
exit 1
end
AWS::S3::Base.establish_connection!(
:access_key_id => ENV["HEROKU_RELEASE_ACCESS"],
:secret_access_key => ENV["HEROKU_RELEASE_SECRET"]
:access_key_id => ENV["DAVID_RELEASE_ACCESS"],
:secret_access_key => ENV["DAVID_RELEASE_SECRET"]
)
@s3_connected = true
end
def store(package_file, filename, bucket="assets.heroku.com")
def store(package_file, filename, bucket="assets.foreman.io")
s3_connect
puts "storing: #{filename}"
AWS::S3::S3Object.store(filename, File.open(package_file), bucket, :access => :public_read)