dpl 1.8.46.travis.2444.5 → 1.8.46.travis.2449.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dpl/provider/code_deploy.rb +25 -1
- data/spec/provider/code_deploy_spec.rb +14 -5
- 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: 96fb9abc3fc6d052902059b2d8b1b5053ee6ab2b3c77f165ab5781b7ba0ba778
|
4
|
+
data.tar.gz: 65a87f93837a415f656d05ab18a8babb3a1d5cda4653264be72da0c16ce12b27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52387ff08adc657282ac88979234d179b0bda756daf40bf78027246ab5f2c04ed05be0a4735d96eed346b2af80ca8d72431cb2a0a74c929af23e09bdef6aa551
|
7
|
+
data.tar.gz: 70312643c6ca282a022e82084c10e4561b8538d2d9cc94a19cd1b32afda099c0a3cdda6992d6ac9e009c28ca9d85b5342ba54db023d633e0001604928b7b1c82
|
@@ -9,6 +9,10 @@ module DPL
|
|
9
9
|
@code_deploy ||= Aws::CodeDeploy::Client.new(code_deploy_options)
|
10
10
|
end
|
11
11
|
|
12
|
+
def s3api
|
13
|
+
@s3api ||= Aws::S3::Client.new(code_deploy_options)
|
14
|
+
end
|
15
|
+
|
12
16
|
def code_deploy_options
|
13
17
|
code_deploy_options = {
|
14
18
|
region: options[:region] || 'us-east-1',
|
@@ -39,13 +43,23 @@ module DPL
|
|
39
43
|
end
|
40
44
|
end
|
41
45
|
|
46
|
+
def revision_version_info
|
47
|
+
s3obj = s3api.head_object({
|
48
|
+
bucket: option(:bucket),
|
49
|
+
key: s3_key
|
50
|
+
})
|
51
|
+
end
|
52
|
+
|
42
53
|
def s3_revision
|
54
|
+
s3info = revision_version_info
|
43
55
|
{
|
44
56
|
revision_type: 'S3',
|
45
57
|
s3_location: {
|
46
58
|
bucket: option(:bucket),
|
47
59
|
bundle_type: bundle_type,
|
48
|
-
key: s3_key
|
60
|
+
key: s3_key,
|
61
|
+
version: s3info[:version_id],
|
62
|
+
e_tag: s3info[:etag]
|
49
63
|
}
|
50
64
|
}
|
51
65
|
end
|
@@ -61,6 +75,16 @@ module DPL
|
|
61
75
|
end
|
62
76
|
|
63
77
|
def push_app
|
78
|
+
rev = revision()
|
79
|
+
if rev[:s3_location]
|
80
|
+
rev_info = rev[:s3_location]
|
81
|
+
log "Registering app revision with version=#{rev_info[:version]}, etag=#{rev_info[:e_tag]}"
|
82
|
+
end
|
83
|
+
code_deploy.register_application_revision({
|
84
|
+
revision: rev,
|
85
|
+
application_name: options[:application] || option(:application_name),
|
86
|
+
description: options[:description] || default_description
|
87
|
+
})
|
64
88
|
data = code_deploy.create_deployment({
|
65
89
|
revision: revision,
|
66
90
|
application_name: options[:application] || option(:application_name),
|
@@ -89,7 +89,9 @@ describe DPL::Provider::CodeDeploy do
|
|
89
89
|
s3_location: {
|
90
90
|
bucket: 'bucket',
|
91
91
|
bundle_type: 'tar',
|
92
|
-
key: 'key'
|
92
|
+
key: 'key',
|
93
|
+
version: 'object_version_id',
|
94
|
+
e_tag: 'etag'
|
93
95
|
}
|
94
96
|
}
|
95
97
|
|
@@ -162,9 +164,14 @@ describe DPL::Provider::CodeDeploy do
|
|
162
164
|
key = "/some/key.#{bundle_type}"
|
163
165
|
|
164
166
|
before(:each) do
|
165
|
-
|
167
|
+
head_data = provider.s3api.stub_data(:head_object, {
|
168
|
+
version_id: 'object_version_id',
|
169
|
+
etag: 'etag'
|
170
|
+
})
|
171
|
+
provider.s3api.stub_responses(:head_object, head_data)
|
172
|
+
expect(provider).to receive(:option).with(:bucket).and_return(bucket).twice
|
166
173
|
expect(provider).to receive(:bundle_type).and_return(bundle_type)
|
167
|
-
expect(provider).to receive(:s3_key).and_return(key)
|
174
|
+
expect(provider).to receive(:s3_key).and_return(key).twice
|
168
175
|
end
|
169
176
|
|
170
177
|
example do
|
@@ -173,7 +180,9 @@ describe DPL::Provider::CodeDeploy do
|
|
173
180
|
s3_location: {
|
174
181
|
bucket: bucket,
|
175
182
|
bundle_type: bundle_type,
|
176
|
-
key: key
|
183
|
+
key: key,
|
184
|
+
version: 'object_version_id',
|
185
|
+
e_tag: 'etag'
|
177
186
|
}
|
178
187
|
})
|
179
188
|
end
|
@@ -357,4 +366,4 @@ describe DPL::Provider::CodeDeploy do
|
|
357
366
|
provider.check_auth
|
358
367
|
end
|
359
368
|
end
|
360
|
-
end
|
369
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dpl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.46.travis.
|
4
|
+
version: 1.8.46.travis.2449.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Haase
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|