dpl 1.8.47.travis.2484.5 → 1.8.47.travis.2485.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/dpl/provider/code_deploy.rb +19 -12
- data/spec/provider/code_deploy_spec.rb +5 -8
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a2698d9b83b3abe7dbee75e7209004d2865d70ca02ea4903f19ff4cadc19f212
|
|
4
|
+
data.tar.gz: 01c556f6646af1105a924708c0d39c95ca24a5d77b139260bf5f0614896acc8b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 02c6b15694c842413acd57745483dac4cf482a1984b672773c56e4a2348de1369a14bc055e81d27ece1890bc6d862c657dda5d4716a444665fd1a4b0dfffa002
|
|
7
|
+
data.tar.gz: e628c3094b866928938bf0c030bf8654b0a9d8c0df3e74e0a22389161af6dd7c855b91bef1667ae6789f3756d6d20caed6db788379d81290bd1e6402ddfb0fe4
|
|
@@ -44,24 +44,29 @@ module DPL
|
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def revision_version_info
|
|
47
|
-
|
|
47
|
+
s3api.head_object({
|
|
48
48
|
bucket: option(:bucket),
|
|
49
49
|
key: s3_key
|
|
50
50
|
})
|
|
51
|
+
rescue Aws::Errors::ServiceError
|
|
52
|
+
{}
|
|
51
53
|
end
|
|
52
54
|
|
|
53
55
|
def s3_revision
|
|
54
|
-
|
|
55
|
-
{
|
|
56
|
+
info = {
|
|
56
57
|
revision_type: 'S3',
|
|
57
58
|
s3_location: {
|
|
58
59
|
bucket: option(:bucket),
|
|
59
60
|
bundle_type: bundle_type,
|
|
60
61
|
key: s3_key,
|
|
61
|
-
version: s3info[:version_id],
|
|
62
|
-
e_tag: s3info[:etag]
|
|
63
62
|
}
|
|
64
63
|
}
|
|
64
|
+
unless revision_version_info.empty?
|
|
65
|
+
info[:s3_location][:version] = revision_version_info[:version_id]
|
|
66
|
+
info[:s3_location][:e_tag] = revision_version_info[:etag]
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
info
|
|
65
70
|
end
|
|
66
71
|
|
|
67
72
|
def github_revision
|
|
@@ -76,15 +81,17 @@ module DPL
|
|
|
76
81
|
|
|
77
82
|
def push_app
|
|
78
83
|
rev = revision()
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
rev_info = rev[:s3_location]
|
|
85
|
+
|
|
86
|
+
if rev_info && rev_info[:version]
|
|
81
87
|
log "Registering app revision with version=#{rev_info[:version]}, etag=#{rev_info[:e_tag]}"
|
|
88
|
+
code_deploy.register_application_revision({
|
|
89
|
+
revision: rev,
|
|
90
|
+
application_name: options[:application] || option(:application_name),
|
|
91
|
+
description: options[:description] || default_description
|
|
92
|
+
})
|
|
82
93
|
end
|
|
83
|
-
|
|
84
|
-
revision: rev,
|
|
85
|
-
application_name: options[:application] || option(:application_name),
|
|
86
|
-
description: options[:description] || default_description
|
|
87
|
-
})
|
|
94
|
+
|
|
88
95
|
data = code_deploy.create_deployment({
|
|
89
96
|
revision: revision,
|
|
90
97
|
application_name: options[:application] || option(:application_name),
|
|
@@ -164,27 +164,24 @@ describe DPL::Provider::CodeDeploy do
|
|
|
164
164
|
key = "/some/key.#{bundle_type}"
|
|
165
165
|
|
|
166
166
|
before(:each) do
|
|
167
|
-
head_data = provider.s3api.
|
|
167
|
+
head_data = provider.s3api.stub(:head_object).and_return({
|
|
168
168
|
version_id: 'object_version_id',
|
|
169
169
|
etag: 'etag'
|
|
170
170
|
})
|
|
171
171
|
provider.s3api.stub_responses(:head_object, head_data)
|
|
172
|
-
expect(provider).to receive(:option).with(:bucket).and_return(bucket)
|
|
172
|
+
expect(provider).to receive(:option).at_least(1).times.with(:bucket).and_return(bucket)
|
|
173
173
|
expect(provider).to receive(:bundle_type).and_return(bundle_type)
|
|
174
|
-
expect(provider).to receive(:s3_key).and_return(key)
|
|
174
|
+
expect(provider).to receive(:s3_key).at_least(1).times.and_return(key)
|
|
175
175
|
end
|
|
176
176
|
|
|
177
177
|
example do
|
|
178
|
-
expect(provider.s3_revision).to
|
|
179
|
-
revision_type: 'S3',
|
|
180
|
-
s3_location: {
|
|
178
|
+
expect(provider.s3_revision[:s3_location]).to include(
|
|
181
179
|
bucket: bucket,
|
|
182
180
|
bundle_type: bundle_type,
|
|
183
181
|
key: key,
|
|
184
182
|
version: 'object_version_id',
|
|
185
183
|
e_tag: 'etag'
|
|
186
|
-
|
|
187
|
-
})
|
|
184
|
+
)
|
|
188
185
|
end
|
|
189
186
|
end
|
|
190
187
|
|