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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f3b30584a77e5baacef99591ecf51e304b1ed4c264110828ce607e8119787c8
4
- data.tar.gz: 79b0eace9dc64bea95e735a5dcd0363f736cc4ad9e033e76e04ec4cf65f2f8f6
3
+ metadata.gz: 96fb9abc3fc6d052902059b2d8b1b5053ee6ab2b3c77f165ab5781b7ba0ba778
4
+ data.tar.gz: 65a87f93837a415f656d05ab18a8babb3a1d5cda4653264be72da0c16ce12b27
5
5
  SHA512:
6
- metadata.gz: 990c3a6936b3e6943eb3b7cd6e46b03e57e032967d6f18eec19b5ee947fb67b60f48845f287b1bf03d2436e682251d083b554f17b8d6ee48b003de35806b425a
7
- data.tar.gz: 1175a06901503a46076f1f80570a98cc964b9e101cd0d9c3adc0b8ff41ea2d1c09f8583fef864ac67a4118f903ddadda640c4c9d53a17cc78784a9530fd5281d
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
- expect(provider).to receive(:option).with(:bucket).and_return(bucket)
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.2444.5
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-19 00:00:00.000000000 Z
11
+ date: 2018-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec