releasecop 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ffb36cc735e139672cdfb89821036b72bed63f2c0bd212da55b757d75209e0e
4
- data.tar.gz: b4247bfc1336ef8e9164aa179aea52f4156e0b5f6cde04d1ca686563f104883f
3
+ metadata.gz: e74295398f9e088f40e44a6303f3c7558a50828b9ab0ca6b8c666b537dcb254e
4
+ data.tar.gz: 941b561af5e4c999a5e4ee6165c56550250599b59fc41a74fdd3cde3101e3c36
5
5
  SHA512:
6
- metadata.gz: 1c0bce5cdc0c17604327da87c0c18e34516d14336ad053c1c5a4f4608a75adbefb72586369a6c3ab182654d1d7f0673dfad22560d709cde08464b07b78d07c59
7
- data.tar.gz: b7d660cb20ce653fd9a3d185ab44a6e8006f20d16e1b5d286be3f177585b7b41ff059ffa9f870c17c123a892f5e3169899404493eba2ba25e041051da465a86c
6
+ metadata.gz: e36752f2f61a9fe2a5c7b8fb014bd495f46f304456af6ccbe369d77c41fa809c44a4bb166227c8027a9e60459801d22536a10cdd70b3a1af399454eec04dfcce
7
+ data.tar.gz: 9991960baa2ab1838f2e9199023f1b93660f3b5e0a18ac8b3522cff06217a14f891414c35e61b093c25bf065f5a886fe2e3efb2e55cd375847fcb3fb66b59b8a
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
  ------------
3
3
  * Your contribution here...
4
4
 
5
+ 0.0.11 (2018-11-14)
6
+ ---
7
+ * Allow AWS credentials to be customized per manifest item (e6397b4)
8
+
5
9
  0.0.10 (2018-11-09)
6
10
  ---
7
11
  * Allow working directory to be overridden (d728567)
@@ -1,6 +1,6 @@
1
1
  module Releasecop
2
2
  class ManifestItem
3
- OPTION_KEYS = %w[hokusai tag_pattern]
3
+ OPTION_KEYS = %w[hokusai tag_pattern, aws_access_key_id, aws_secret_access_key]
4
4
  attr_reader :git, :branch, :name
5
5
 
6
6
  def initialize(repo_name, item)
@@ -23,12 +23,8 @@ module Releasecop
23
23
 
24
24
  private
25
25
 
26
- def working_dir
27
- "#{@repo_name}-#{@name}-working"
28
- end
29
-
30
26
  def find_hokusai_sha
31
- images_output = `hokusai registry images`
27
+ images_output = with_aws_env { `hokusai registry images` }
32
28
  tags = images_output.lines.grep(/\d{4}.* | .* | .*/).map{|l| l.split(' | ').last.split(',').map(&:strip)}
33
29
  tags.detect{|t| t.include?(@options['hokusai']) }.detect{|t| t[/^[0-9a-f]{40}$/]}
34
30
  end
@@ -36,5 +32,16 @@ module Releasecop
36
32
  def find_tag_pattern_sha
37
33
  `git for-each-ref --format='%(objectname)' --count=1 --sort=-authordate --sort=-committerdate 'refs/tags/#{@options['tag_pattern']}'`.strip
38
34
  end
35
+
36
+ # not thread-safe
37
+ def with_aws_env(&block)
38
+ ENV.update(
39
+ 'AWS_ACCESS_KEY_ID' => @options['aws_access_key_id'],
40
+ 'AWS_SECRET_ACCESS_KEY' => @options['aws_secret_access_key']
41
+ )
42
+ yield
43
+ ensure
44
+ ENV.update('AWS_ACCESS_KEY_ID' => nil, 'AWS_SECRET_ACCESS_KEY' => nil)
45
+ end
39
46
  end
40
47
  end
@@ -1,3 +1,3 @@
1
1
  module Releasecop
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: releasecop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joey Aghion
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-09 00:00:00.000000000 Z
11
+ date: 2018-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor