heirloom 0.12.1 → 0.12.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +1 -0
- data/CHANGELOG.md +6 -0
- data/README.md +12 -6
- data/heirloom.gemspec +3 -5
- data/lib/heirloom/catalog/verify.rb +2 -2
- data/lib/heirloom/cli/authorize.rb +1 -2
- data/lib/heirloom/cli/catalog.rb +62 -19
- data/lib/heirloom/cli/cleanup.rb +1 -2
- data/lib/heirloom/cli/destroy.rb +1 -2
- data/lib/heirloom/cli/download.rb +2 -3
- data/lib/heirloom/cli/formatter/catalog.rb +25 -11
- data/lib/heirloom/cli/list.rb +1 -3
- data/lib/heirloom/cli/rotate.rb +1 -2
- data/lib/heirloom/cli/setup.rb +1 -2
- data/lib/heirloom/cli/shared.rb +3 -0
- data/lib/heirloom/cli/show.rb +1 -3
- data/lib/heirloom/cli/tag.rb +1 -2
- data/lib/heirloom/cli/teardown.rb +1 -2
- data/lib/heirloom/cli/upload.rb +1 -2
- data/lib/heirloom/version.rb +1 -1
- data/spec/acl/s3_spec.rb +11 -11
- data/spec/archive/authorizer_spec.rb +20 -20
- data/spec/archive/builder_spec.rb +13 -13
- data/spec/archive/checker_spec.rb +24 -24
- data/spec/archive/destroyer_spec.rb +20 -20
- data/spec/archive/downloader_spec.rb +30 -30
- data/spec/archive/lister_spec.rb +7 -7
- data/spec/archive/reader_spec.rb +65 -65
- data/spec/archive/setup_spec.rb +27 -27
- data/spec/archive/teardowner_spec.rb +19 -19
- data/spec/archive/updater_spec.rb +10 -10
- data/spec/archive/uploader_spec.rb +26 -26
- data/spec/archive/verifier_spec.rb +25 -25
- data/spec/archive/writer_spec.rb +11 -11
- data/spec/archive_spec.rb +91 -93
- data/spec/aws/s3_spec.rb +102 -102
- data/spec/aws/simpledb_spec.rb +33 -63
- data/spec/catalog/add_spec.rb +12 -12
- data/spec/catalog/delete_spec.rb +14 -14
- data/spec/catalog/list_spec.rb +8 -8
- data/spec/catalog/setup_spec.rb +11 -11
- data/spec/catalog/show_spec.rb +13 -13
- data/spec/catalog/verify_spec.rb +16 -16
- data/spec/catalog_spec.rb +36 -36
- data/spec/cipher/data_spec.rb +19 -19
- data/spec/cipher/file_spec.rb +11 -11
- data/spec/cli/authorize_spec.rb +16 -16
- data/spec/cli/catalog_spec.rb +18 -34
- data/spec/cli/destroy_spec.rb +13 -13
- data/spec/cli/download_spec.rb +31 -31
- data/spec/cli/formatter/catalog_spec.rb +19 -17
- data/spec/cli/list_spec.rb +14 -14
- data/spec/cli/rotate_spec.rb +9 -9
- data/spec/cli/setup_spec.rb +29 -29
- data/spec/cli/shared_spec.rb +119 -119
- data/spec/cli/show_spec.rb +20 -20
- data/spec/cli/tag_spec.rb +18 -18
- data/spec/cli/teardown_spec.rb +28 -28
- data/spec/cli/upload_spec.rb +38 -38
- data/spec/config_spec.rb +21 -21
- data/spec/destroyer/s3_spec.rb +6 -6
- data/spec/directory/directory_spec.rb +19 -19
- data/spec/downloader/s3_spec.rb +18 -18
- data/spec/logger_spec.rb +9 -9
- data/spec/spec_helper.rb +4 -80
- data/spec/uploader/s3_spec.rb +35 -35
- metadata +23 -56
- data/spec/integration/authorize_spec.rb +0 -79
- data/spec/integration/cleanup_spec.rb +0 -77
- data/watchr.rb +0 -101
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: decae42c86e0f9136bccc91e721bc442e9bb7370
|
4
|
+
data.tar.gz: 66989f1a4f9018f4e39383c1fd28c230d69566c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38a972e23a71f7f797959acac530987d9b3e6199aaf44bf6b56d174a344178ac4e00886e86decaf2f3105855b088ddd02e4a3e7339b2f05f523f4fc4241d8a9e
|
7
|
+
data.tar.gz: 499f01de342b1d059156336495f172a302a5d9fe824123643b78d4e4f6216917c98d2af69a1b0455a16e1f0de5f0f7c402d1259911ddfb8e24c9eaf3d787659c
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.1.0
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
[![Build Status](https://secure.travis-ci.org/intuit/heirloom.png)](http://travis-ci.org/intuit/heirloom)
|
2
|
-
|
2
|
+
[![Code Climate](https://codeclimate.com/github/intuit/heirloom.png)](https://codeclimate.com/github/intuit/heirloom)
|
3
3
|
Heirloom
|
4
4
|
========
|
5
5
|
|
@@ -26,18 +26,24 @@ To get started, copy the sample below to ~/.heirloom.yml and update the specifie
|
|
26
26
|
|
27
27
|
```
|
28
28
|
# default environment
|
29
|
+
|
29
30
|
default:
|
30
31
|
access_key: UPDATE_ME
|
31
32
|
secret_key: UPDATE_ME
|
32
33
|
metadata_region: us-west-1
|
33
|
-
|
34
|
+
|
34
35
|
# multiple environments can be defined and
|
35
36
|
# selected via cli with -e or --environment
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
prod:
|
39
|
+
access_key: UPDATE_ME
|
40
|
+
secret_key: UPDATE_ME
|
41
|
+
metadata_region: us-west-1
|
42
|
+
|
43
|
+
preprod:
|
44
|
+
access_key: UPDATE_ME
|
45
|
+
secret_key: UPDATE_ME
|
46
|
+
metadata_region: us-west-1
|
41
47
|
```
|
42
48
|
|
43
49
|
You can specify an alternate config file by setting "HEIRLOOM_CONFIG_FILE"
|
data/heirloom.gemspec
CHANGED
@@ -20,13 +20,11 @@ Gem::Specification.new do |s|
|
|
20
20
|
|
21
21
|
# specify any dependencies here; for example:
|
22
22
|
s.add_development_dependency "rake"
|
23
|
-
s.add_development_dependency "rspec", '~> 2.
|
23
|
+
s.add_development_dependency "rspec", '~> 2.14.1'
|
24
24
|
s.add_development_dependency "simplecov"
|
25
|
-
s.add_development_dependency "vcr", '= 2.4.0'
|
26
|
-
s.add_development_dependency "watchr"
|
27
25
|
|
28
|
-
s.add_runtime_dependency 'fog', '= 1.
|
26
|
+
s.add_runtime_dependency 'fog', '= 1.21.0'
|
29
27
|
s.add_runtime_dependency 'hashie', '= 2.0.5'
|
30
28
|
s.add_runtime_dependency 'trollop', '= 2.0'
|
31
|
-
s.add_runtime_dependency 'xml-simple', '~> 1.1.
|
29
|
+
s.add_runtime_dependency 'xml-simple', '~> 1.1.3'
|
32
30
|
end
|
@@ -10,10 +10,10 @@ module Heirloom
|
|
10
10
|
|
11
11
|
def catalog_domain_exists?
|
12
12
|
if sdb.domain_exists? 'heirloom'
|
13
|
-
@logger.debug "Catalog exists in #{@region}."
|
13
|
+
@logger.debug "Catalog of Heirlooms exists in #{@region}."
|
14
14
|
true
|
15
15
|
else
|
16
|
-
@logger.debug "Catalog does not exist in #{@region}."
|
16
|
+
@logger.debug "Catalog of Heirlooms does not exist in #{@region}."
|
17
17
|
false
|
18
18
|
end
|
19
19
|
end
|
@@ -57,8 +57,7 @@ EOS
|
|
57
57
|
opt :id, "ID of the Heirloom to authorize.", :type => :string
|
58
58
|
opt :level, "Log level [debug|info|warn|error].", :type => :string,
|
59
59
|
:default => 'info'
|
60
|
-
opt :metadata_region, "AWS region to store Heirloom metadata.", :type
|
61
|
-
:default => 'us-west-1'
|
60
|
+
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
62
61
|
opt :name, "Name of Heirloom.", :type => :string
|
63
62
|
opt :aws_access_key, "AWS Access Key ID", :type => :string,
|
64
63
|
:short => :none
|
data/lib/heirloom/cli/catalog.rb
CHANGED
@@ -17,27 +17,71 @@ module Heirloom
|
|
17
17
|
ensure_valid_options :provided => @opts,
|
18
18
|
:required => [],
|
19
19
|
:config => @config
|
20
|
-
ensure_valid_region :region => @opts[:metadata_region],
|
21
|
-
:config => @config
|
22
|
-
@catalog = Heirloom::Catalog.new :config => @config
|
23
|
-
ensure_catalog_domain_exists :config => @config,
|
24
|
-
:catalog => @catalog
|
25
20
|
end
|
26
21
|
|
27
22
|
def all
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
23
|
+
detected_regions.each do |region|
|
24
|
+
@config.metadata_region = region
|
25
|
+
|
26
|
+
ensure_valid_region :region => region,
|
27
|
+
:config => @config
|
28
|
+
|
29
|
+
next unless catalog_domain_exists?
|
30
|
+
|
31
|
+
@catalog_list = Hash[@catalog.all]
|
32
|
+
|
33
|
+
unless @opts[:name]
|
34
|
+
heirloom_summary region
|
35
|
+
@heirloom_found = true
|
36
|
+
next
|
37
|
+
end
|
38
|
+
|
39
|
+
if heirloom_exists_in_catalog? @opts[:name]
|
40
|
+
@logger.debug "Heirloom \'#{@opts[:name]}\' found in catalog for #{region}."
|
41
|
+
heirloom_details region, @opts[:name]
|
42
|
+
@heirloom_found = true
|
43
|
+
else
|
44
|
+
@logger.debug "Heirloom \'#{@opts[:name]}\' not found in catalog for #{region}."
|
45
|
+
end
|
34
46
|
end
|
47
|
+
|
48
|
+
@logger.info "Heirloom \'#{@opts[:name]}\' not found in any regions." unless @heirloom_found
|
35
49
|
end
|
36
50
|
|
37
51
|
private
|
38
52
|
|
39
|
-
def
|
40
|
-
|
53
|
+
def heirloom_summary(region)
|
54
|
+
puts formatter.summary_format :region => region
|
55
|
+
end
|
56
|
+
|
57
|
+
def heirloom_details(region,name)
|
58
|
+
puts formatter.detailed_format :region => region,
|
59
|
+
:name => name
|
60
|
+
end
|
61
|
+
|
62
|
+
def catalog_domain_exists?
|
63
|
+
@catalog = Heirloom::Catalog.new :config => @config
|
64
|
+
ensure_catalog_domain_exists :config => @config,
|
65
|
+
:catalog => @catalog,
|
66
|
+
:continue_on_error => true
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
def default_regions
|
71
|
+
%w(us-east-1 us-west-1 us-west-2)
|
72
|
+
end
|
73
|
+
|
74
|
+
def detected_regions
|
75
|
+
return default_regions if @opts[:all_regions]
|
76
|
+
Array(@opts[:metadata_region] || @config.metadata_region || default_regions)
|
77
|
+
end
|
78
|
+
|
79
|
+
def formatter
|
80
|
+
@formatter = Heirloom::CLI::Formatter::Catalog.new :catalog => @catalog_list
|
81
|
+
end
|
82
|
+
|
83
|
+
def heirloom_exists_in_catalog?(name)
|
84
|
+
@catalog_list.include? "heirloom_#{name}"
|
41
85
|
end
|
42
86
|
|
43
87
|
def read_options
|
@@ -51,17 +95,16 @@ Usage:
|
|
51
95
|
|
52
96
|
heirloom catalog
|
53
97
|
|
54
|
-
EOS
|
98
|
+
EOS
|
55
99
|
opt :help, "Display Help"
|
56
100
|
opt :level, "Log level [debug|info|warn|error].", :type => :string,
|
57
101
|
:default => 'info'
|
58
|
-
opt :json, "Dump full catalog as raw JSON."
|
59
102
|
opt :name, "Name of Heirloom to show full details.", :type => :string
|
60
|
-
opt :metadata_region, "AWS region to store Heirloom metadata.", :type
|
61
|
-
|
62
|
-
opt :aws_access_key, "AWS Access Key ID", :type
|
103
|
+
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
104
|
+
opt :all_regions, "Return catalog of all regions."
|
105
|
+
opt :aws_access_key, "AWS Access Key ID", :type => :string,
|
63
106
|
:short => :none
|
64
|
-
opt :aws_secret_key, "AWS Secret Access Key", :type
|
107
|
+
opt :aws_secret_key, "AWS Secret Access Key", :type => :string,
|
65
108
|
:short => :none
|
66
109
|
opt :use_iam_profile, "Use IAM EC2 Profile", :short => :none
|
67
110
|
opt :environment, "Environment (defined in ~/.heirloom.yml)", :type => :string
|
data/lib/heirloom/cli/cleanup.rb
CHANGED
@@ -57,8 +57,7 @@ EOS
|
|
57
57
|
opt :help, "Display Help"
|
58
58
|
opt :log_level, "Log level [debug|info|warn|error].", :type => :string,
|
59
59
|
:default => 'info'
|
60
|
-
opt :metadata_region, "AWS region to store Heirloom metadata.", :type
|
61
|
-
:default => 'us-west-1'
|
60
|
+
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
62
61
|
opt :name, "Name of Heirloom.", :type => :string
|
63
62
|
opt :keep, "Number of unpreserved heirlooms to keep.", :default => 100
|
64
63
|
|
data/lib/heirloom/cli/destroy.rb
CHANGED
@@ -52,8 +52,7 @@ EOS
|
|
52
52
|
opt :id, "ID of the Heirloom to display.", :type => :string
|
53
53
|
opt :level, "Log level [debug|info|warn|error].", :type => :string,
|
54
54
|
:default => 'info'
|
55
|
-
opt :metadata_region, "AWS region to store Heirloom metadata.", :type
|
56
|
-
:default => 'us-west-1'
|
55
|
+
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
57
56
|
opt :name, "Name of Heirloom.", :type => :string
|
58
57
|
opt :aws_access_key, "AWS Access Key ID", :type => :string,
|
59
58
|
:short => :none
|
@@ -77,13 +77,12 @@ EOS
|
|
77
77
|
opt :id, "ID of the Heirloom to download.", :type => :string
|
78
78
|
opt :level, "Log level [debug|info|warn|error].", :type => :string,
|
79
79
|
:default => 'info'
|
80
|
-
opt :metadata_region, "AWS region to store Heirloom metadata.", :type
|
81
|
-
:default => 'us-west-1'
|
80
|
+
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
82
81
|
opt :name, "Name of Heirloom.", :type => :string
|
83
82
|
opt :output, "Path to output downloaded Heirloom. Must be existing directory.", :type => :string
|
84
83
|
opt :region, "Region to download Heirloom.", :type => :string,
|
85
84
|
:default => 'us-west-1'
|
86
|
-
opt :secret, "Secret for
|
85
|
+
opt :secret, "Secret for encrypted Heirloom.", :type => :string
|
87
86
|
opt :secret_file, "Read secret from file.", :type => :string,
|
88
87
|
:short => :none
|
89
88
|
opt :aws_access_key, "AWS Access Key ID", :type => :string,
|
@@ -2,41 +2,55 @@ module Heirloom
|
|
2
2
|
module CLI
|
3
3
|
module Formatter
|
4
4
|
class Catalog
|
5
|
-
def format(args)
|
6
|
-
@catalog = args[:catalog]
|
7
|
-
@name = args[:name]
|
8
5
|
|
9
|
-
|
6
|
+
def initialize(args)
|
7
|
+
@catalog = args[:catalog]
|
8
|
+
end
|
10
9
|
|
11
|
-
|
10
|
+
def detailed_format(args)
|
11
|
+
@name = args[:name]
|
12
|
+
@region = args[:region]
|
12
13
|
|
13
14
|
filter_by_name
|
14
15
|
details
|
16
|
+
end
|
17
|
+
|
18
|
+
def summary_format(args)
|
19
|
+
@region = args[:region]
|
20
|
+
|
21
|
+
summary
|
15
22
|
end
|
16
23
|
|
17
24
|
private
|
18
25
|
|
19
|
-
def
|
20
|
-
@catalog.
|
26
|
+
def remove_heirloom_prefix
|
27
|
+
Hash[@catalog.sort.map { |k, v| [k.sub(/heirloom_/, ''), v] }]
|
28
|
+
end
|
29
|
+
|
30
|
+
def add_indent_prefix
|
31
|
+
Hash[remove_heirloom_prefix.sort.map { |k, v| [k.sub(/^/, ' '), v] }]
|
21
32
|
end
|
22
33
|
|
23
34
|
def filter_by_name
|
24
|
-
@catalog.select! {|k| @name == k }
|
35
|
+
@catalog.select! {|k| "heirloom_#{@name}" == k }
|
25
36
|
end
|
26
37
|
|
27
38
|
def summary
|
28
|
-
@
|
39
|
+
s = @region + "\n"
|
40
|
+
s << add_indent_prefix.keys.join("\n")
|
29
41
|
end
|
30
42
|
|
31
43
|
def details
|
44
|
+
@catalog = remove_heirloom_prefix
|
32
45
|
data = @catalog.each_pair.map do |k,v|
|
33
|
-
urls = v["regions"].map do |region|
|
46
|
+
urls = v["regions"].sort.map do |region|
|
34
47
|
bucket_prefix = v["bucket_prefix"].first
|
35
48
|
" #{region}-s3-url : s3://#{bucket_prefix}-#{region}/#{k}"
|
36
49
|
end
|
37
50
|
|
38
51
|
d = k + "\n"
|
39
|
-
d << "
|
52
|
+
d << " metadata_region : #{@region}\n"
|
53
|
+
d << " regions : " + @catalog[k]["regions"].sort.join(", ") + "\n"
|
40
54
|
d << " bucket_prefix : " + @catalog[k]["bucket_prefix"].first + "\n"
|
41
55
|
d << urls.join("\n")
|
42
56
|
end
|
data/lib/heirloom/cli/list.rb
CHANGED
@@ -52,11 +52,9 @@ EOS
|
|
52
52
|
opt :count, "Number of IDs to return.", :type => :integer,
|
53
53
|
:default => 10
|
54
54
|
opt :help, "Display Help"
|
55
|
-
opt :json, "Display output as raw JSON."
|
56
55
|
opt :level, "Log level [debug|info|warn|error].", :type => :string,
|
57
56
|
:default => 'info'
|
58
|
-
opt :metadata_region, "AWS region to store Heirloom metadata.", :type
|
59
|
-
:default => 'us-west-1'
|
57
|
+
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
60
58
|
opt :name, "Name of Heirloom.", :type => :string
|
61
59
|
opt :aws_access_key, "AWS Access Key ID", :type => :string,
|
62
60
|
:short => :none
|
data/lib/heirloom/cli/rotate.rb
CHANGED
@@ -66,8 +66,7 @@ EOS
|
|
66
66
|
opt :id, "ID of the Heirloom to rotate.", :type => :string
|
67
67
|
opt :level, "Log level [debug|info|warn|error].", :type => :string,
|
68
68
|
:default => 'info'
|
69
|
-
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
70
|
-
:default => 'us-west-1'
|
69
|
+
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
71
70
|
opt :name, "Name of Heirloom.", :type => :string
|
72
71
|
opt :region, "Region to download Heirloom.", :type => :string,
|
73
72
|
:default => 'us-west-1'
|
data/lib/heirloom/cli/setup.rb
CHANGED
@@ -81,8 +81,7 @@ us-east-1' will create bucket test-us-west-1 in us-west-1 and test-us-east-1 in
|
|
81
81
|
opt :help, "Display Help"
|
82
82
|
opt :level, "Log level [debug|info|warn|error].", :type => :string,
|
83
83
|
:default => 'info'
|
84
|
-
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
85
|
-
:default => 'us-west-1'
|
84
|
+
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
86
85
|
opt :name, "Name of Heirloom.", :type => :string
|
87
86
|
opt :region, "AWS Region(s) to upload Heirloom. \
|
88
87
|
Can be specified multiple times.", :type => :string,
|
data/lib/heirloom/cli/shared.rb
CHANGED
@@ -167,13 +167,16 @@ module Heirloom
|
|
167
167
|
def ensure_catalog_domain_exists(args)
|
168
168
|
config = args[:config]
|
169
169
|
catalog = args[:catalog]
|
170
|
+
continue_on_error = args[:continue_on_error]
|
170
171
|
logger = config.logger
|
171
172
|
region = config.metadata_region
|
172
173
|
|
173
174
|
unless catalog.catalog_domain_exists?
|
175
|
+
return false if continue_on_error
|
174
176
|
logger.error "Catalog does not exist in #{region}."
|
175
177
|
exit 1
|
176
178
|
end
|
179
|
+
true
|
177
180
|
end
|
178
181
|
|
179
182
|
def ensure_entry_exists_in_catalog(args)
|
data/lib/heirloom/cli/show.rb
CHANGED
@@ -63,11 +63,9 @@ EOS
|
|
63
63
|
opt :help, "Display Help"
|
64
64
|
opt :all, "Display all attributes (includes internal heirloom settings)."
|
65
65
|
opt :id, "ID of the Heirloom to display.", :type => :string
|
66
|
-
opt :json, "Display output as raw JSON."
|
67
66
|
opt :level, "Log level [debug|info|warn|error].", :type => :string,
|
68
67
|
:default => 'info'
|
69
|
-
opt :metadata_region, "AWS region to store Heirloom metadata.", :type
|
70
|
-
:default => 'us-west-1'
|
68
|
+
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
71
69
|
opt :name, "Name of Heirloom.", :type => :string
|
72
70
|
opt :aws_access_key, "AWS Access Key ID", :type => :string,
|
73
71
|
:short => :none
|
data/lib/heirloom/cli/tag.rb
CHANGED
@@ -56,8 +56,7 @@ EOS
|
|
56
56
|
opt :id, "ID of the Heirloom to tag.", :type => :string
|
57
57
|
opt :level, "Log level [debug|info|warn|error].", :type => :string,
|
58
58
|
:default => 'info'
|
59
|
-
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
60
|
-
:default => 'us-west-1'
|
59
|
+
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
61
60
|
opt :name, "Name of Heirloom.", :type => :string
|
62
61
|
opt :value, "Value of attribute.", :type => :string,
|
63
62
|
:short => 'u'
|
@@ -73,8 +73,7 @@ EOS
|
|
73
73
|
opt :help, "Display Help"
|
74
74
|
opt :level, "Log level [debug|info|warn|error].", :type => :string,
|
75
75
|
:default => 'info'
|
76
|
-
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
77
|
-
:default => 'us-west-1'
|
76
|
+
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
78
77
|
opt :name, "Name of Heirloom.", :type => :string
|
79
78
|
opt :force, "Forces recursive deletion of existing archives."
|
80
79
|
opt :keep_buckets, "Do not delete S3 buckets."
|
data/lib/heirloom/cli/upload.rb
CHANGED
@@ -93,8 +93,7 @@ Can be specified multiple times.", :type => :string, :multi => true, :short =>
|
|
93
93
|
opt :id, "ID for Heirloom.", :type => :string
|
94
94
|
opt :level, "Log level [debug|info|warn|error].", :type => :string,
|
95
95
|
:default => 'info'
|
96
|
-
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
97
|
-
:default => 'us-west-1'
|
96
|
+
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string
|
98
97
|
opt :name, "Name of Heirloom.", :type => :string
|
99
98
|
opt :public, "Set this Heirloom as public readable?"
|
100
99
|
opt :secret, "Encrypt the Heirloom with given secret.", :type => :string
|
data/lib/heirloom/version.rb
CHANGED
data/spec/acl/s3_spec.rb
CHANGED
@@ -2,11 +2,11 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Heirloom do
|
4
4
|
before do
|
5
|
-
@
|
6
|
-
@
|
7
|
-
@
|
5
|
+
@config_double = double 'config'
|
6
|
+
@logger_double = double 'logger', :info => true, :debug => true
|
7
|
+
@config_double.stub :logger => @logger_double
|
8
8
|
|
9
|
-
@s3 = Heirloom::ACL::S3.new :config => @
|
9
|
+
@s3 = Heirloom::ACL::S3.new :config => @config_double,
|
10
10
|
:region => 'us-west-1'
|
11
11
|
end
|
12
12
|
|
@@ -17,17 +17,17 @@ describe Heirloom do
|
|
17
17
|
'ID' => '123'
|
18
18
|
}
|
19
19
|
}
|
20
|
-
|
20
|
+
s3_double = double 's3'
|
21
21
|
|
22
22
|
@s3.should_receive(:s3).exactly(2).times.
|
23
|
-
and_return(
|
23
|
+
and_return(s3_double)
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
s3_double.should_receive(:get_object_acl).
|
26
|
+
with(:bucket => 'bucket', :object_name => 'key-folder/key.tar.gz').
|
27
|
+
and_return acls
|
28
28
|
|
29
|
-
|
30
|
-
|
29
|
+
s3_double.should_receive(:put_object_acl).
|
30
|
+
with("bucket", "key-folder/key.tar.gz", {"Owner"=>{"DisplayName"=>"Brett", "ID"=>"123"}, "AccessControlList"=>[{"Grantee"=>{"EmailAddress"=>"acct1@test.com"}, "Permission"=>"READ"}, {"Grantee"=>{"EmailAddress"=>"acct2@test.com"}, "Permission"=>"READ"}, {"Grantee"=>{"DisplayName"=>"Brett", "ID"=>"123"}, "Permission"=>"FULL_CONTROL"}]})
|
31
31
|
|
32
32
|
@s3.allow_read_access_from_accounts :bucket => 'bucket',
|
33
33
|
:key_name => 'key.tar.gz',
|