s3deployer 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +22 -0
- data/Rakefile +1 -0
- data/lib/s3deployer/version.rb +3 -0
- data/lib/s3deployer.rb +29 -0
- data/s3deployer.gemspec +16 -0
- metadata +10 -3
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm 1.9.3@s3deployer --create
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
s3deployer (0.0.1)
|
5
|
+
aws-s3
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
aws-s3 (0.6.2)
|
11
|
+
builder
|
12
|
+
mime-types
|
13
|
+
xml-simple
|
14
|
+
builder (3.0.0)
|
15
|
+
mime-types (1.17.2)
|
16
|
+
xml-simple (1.1.1)
|
17
|
+
|
18
|
+
PLATFORMS
|
19
|
+
ruby
|
20
|
+
|
21
|
+
DEPENDENCIES
|
22
|
+
s3deployer!
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/lib/s3deployer.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'aws/s3'
|
2
|
+
class S3Deployer
|
3
|
+
attr_accessor :directory_to_deploy, :bucket_name
|
4
|
+
def initialize(bucket_name, directory_to_deploy)
|
5
|
+
@directory_to_deploy = directory_to_deploy
|
6
|
+
@bucket_name = bucket_name
|
7
|
+
end
|
8
|
+
def deploy
|
9
|
+
iterate_through_and_deploy(directory_to_deploy)
|
10
|
+
end
|
11
|
+
|
12
|
+
def iterate_through_and_deploy(dir)
|
13
|
+
Dir.foreach(dir) do |item|
|
14
|
+
next if item[0] == "."
|
15
|
+
item_location = "#{dir}/#{item}"
|
16
|
+
if File.directory?(item_location)
|
17
|
+
iterate_through_and_deploy(item_location)
|
18
|
+
else
|
19
|
+
upload_item(item_location)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def upload_item(item)
|
25
|
+
s3_name = item.gsub(directory_to_deploy,'')
|
26
|
+
puts "uploading #{item} as #{s3_name}"
|
27
|
+
AWS::S3::S3Object.store(s3_name, open(item), bucket_name)
|
28
|
+
end
|
29
|
+
end
|
data/s3deployer.gemspec
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
$:.push("lib")
|
2
|
+
require 's3deployer/version'
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = 's3deployer'
|
6
|
+
s.version = S3Deployer::VERSION
|
7
|
+
s.platform = Gem::Platform::RUBY
|
8
|
+
s.authors = ['Zee Spencer']
|
9
|
+
s.email = ['zee@zeespencer.com']
|
10
|
+
s.homepage = 'https://github.com/zspencer/s3deployer'
|
11
|
+
s.description = "A simple way to deploy a directory to Amazon s3"
|
12
|
+
s.summary = "A simple way to deploy a directory to Amazon s3"
|
13
|
+
s.files = `git ls-files`.split("\n")
|
14
|
+
s.require_paths = ['lib']
|
15
|
+
s.add_dependency("aws-s3")
|
16
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s3deployer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-03-10 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-s3
|
16
|
-
requirement: &
|
16
|
+
requirement: &70273139563560 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70273139563560
|
25
25
|
description: A simple way to deploy a directory to Amazon s3
|
26
26
|
email:
|
27
27
|
- zee@zeespencer.com
|
@@ -29,7 +29,14 @@ executables: []
|
|
29
29
|
extensions: []
|
30
30
|
extra_rdoc_files: []
|
31
31
|
files:
|
32
|
+
- .rvmrc
|
33
|
+
- Gemfile
|
34
|
+
- Gemfile.lock
|
32
35
|
- README.markdown
|
36
|
+
- Rakefile
|
37
|
+
- lib/s3deployer.rb
|
38
|
+
- lib/s3deployer/version.rb
|
39
|
+
- s3deployer.gemspec
|
33
40
|
homepage: https://github.com/zspencer/s3deployer
|
34
41
|
licenses: []
|
35
42
|
post_install_message:
|