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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/releasecop/manifest_item.rb +13 -6
- data/lib/releasecop/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e74295398f9e088f40e44a6303f3c7558a50828b9ab0ca6b8c666b537dcb254e
|
4
|
+
data.tar.gz: 941b561af5e4c999a5e4ee6165c56550250599b59fc41a74fdd3cde3101e3c36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e36752f2f61a9fe2a5c7b8fb014bd495f46f304456af6ccbe369d77c41fa809c44a4bb166227c8027a9e60459801d22536a10cdd70b3a1af399454eec04dfcce
|
7
|
+
data.tar.gz: 9991960baa2ab1838f2e9199023f1b93660f3b5e0a18ac8b3522cff06217a14f891414c35e61b093c25bf065f5a886fe2e3efb2e55cd375847fcb3fb66b59b8a
|
data/CHANGELOG.md
CHANGED
@@ -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
|
data/lib/releasecop/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2018-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|