dpl-releases 1.10.6.travis.3118.5 → 1.10.6.travis.3119.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/releases.rb +20 -1
- data/spec/provider/releases_spec.rb +12 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1421a875eed37cc223d409b277d2561cbab484de1d4207c873f090e1f77b57cd
|
4
|
+
data.tar.gz: a48df6ae8d4cd0c60b64cc0552af8ea83068565362f1aca10326710ad3f2f651
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a7ba603fe13b13d756b9161e6404f3cc890f004b9e80a97863636ab58568f9d8bee519ab8c3cd41aa8e94e37b73355c5badaa8f1089f1057599380f2a12b199
|
7
|
+
data.tar.gz: e92619a0441f32e4b0e68c8e93677f8ee57068a244b187a8d52e0818158aea603d0a4e1a539b395053fe611627086cc579b5ab8cc015093382ab122013131b54
|
@@ -11,6 +11,10 @@ module DPL
|
|
11
11
|
prerelease
|
12
12
|
)
|
13
13
|
|
14
|
+
def self.new(context, options)
|
15
|
+
super(context, options.merge!({needs_git_http_user_agent: false}))
|
16
|
+
end
|
17
|
+
|
14
18
|
def travis_tag
|
15
19
|
# Check if $TRAVIS_TAG is unset or set but empty
|
16
20
|
if context.env.fetch('TRAVIS_TAG','') == ''
|
@@ -113,7 +117,14 @@ module DPL
|
|
113
117
|
end
|
114
118
|
|
115
119
|
files.each do |file|
|
116
|
-
|
120
|
+
unless File.exist?(file)
|
121
|
+
log "#{file} does not exist."
|
122
|
+
next
|
123
|
+
end
|
124
|
+
unless File.file?(file)
|
125
|
+
log "#{file} is not a regular file. Skipping."
|
126
|
+
next
|
127
|
+
end
|
117
128
|
existing_url = nil
|
118
129
|
filename = Pathname.new(file).basename.to_s
|
119
130
|
api.release_assets(release_url).each do |existing_file|
|
@@ -132,6 +143,14 @@ module DPL
|
|
132
143
|
end
|
133
144
|
end
|
134
145
|
|
146
|
+
if ! options.key?(:tag_name) && options[:draft]
|
147
|
+
options[:tag_name] = get_tag.tap {|tag| log "Setting tag_name to #{tag}"}
|
148
|
+
end
|
149
|
+
|
150
|
+
unless options.key?(:target_commitish)
|
151
|
+
options[:target_commitish] = sha.tap {|commitish| log "Setting target_commitish to #{commitish}"}
|
152
|
+
end
|
153
|
+
|
135
154
|
api.update_release(release_url, {:draft => false}.merge(options))
|
136
155
|
end
|
137
156
|
|
@@ -160,6 +160,8 @@ describe DPL::Provider::Releases do
|
|
160
160
|
|
161
161
|
allow(provider).to receive(:releases).and_return([""])
|
162
162
|
allow(provider).to receive(:get_tag).and_return("v0.0.0")
|
163
|
+
expect(File).to receive(:exist?).with("test/foo.bar").and_return(true)
|
164
|
+
expect(File).to receive(:exist?).with("bar.txt").and_return(true)
|
163
165
|
expect(File).to receive(:file?).with("test/foo.bar").and_return(true)
|
164
166
|
expect(File).to receive(:file?).with("bar.txt").and_return(true)
|
165
167
|
|
@@ -185,6 +187,8 @@ describe DPL::Provider::Releases do
|
|
185
187
|
|
186
188
|
allow(provider).to receive(:releases).and_return([""])
|
187
189
|
allow(provider).to receive(:get_tag).and_return("v0.0.0")
|
190
|
+
expect(File).to receive(:exist?).with("test/foo.bar").and_return(true)
|
191
|
+
expect(File).to receive(:exist?).with("bar.txt").and_return(true)
|
188
192
|
expect(File).to receive(:file?).with("test/foo.bar").and_return(true)
|
189
193
|
expect(File).to receive(:file?).with("bar.txt").and_return(true)
|
190
194
|
|
@@ -197,7 +201,7 @@ describe DPL::Provider::Releases do
|
|
197
201
|
allow(provider.api).to receive(:release_assets).and_return([double(:name => "foo.bar", :url => 'foo-bar-url'), double(:name => "foo.foo", :url => 'foo-foo-url')])
|
198
202
|
|
199
203
|
expect(provider.api).to receive(:upload_asset).with(anything, "bar.txt", {:name=>"bar.txt", :content_type=>"text/plain"})
|
200
|
-
|
204
|
+
allow(provider).to receive(:log)
|
201
205
|
expect(provider.api).to receive(:update_release).with(anything, hash_including(:draft => false))
|
202
206
|
|
203
207
|
provider.push_app
|
@@ -211,6 +215,7 @@ describe DPL::Provider::Releases do
|
|
211
215
|
|
212
216
|
allow(provider).to receive(:releases).and_return([""])
|
213
217
|
allow(provider).to receive(:get_tag).and_return("v0.0.0")
|
218
|
+
expect(File).to receive(:exist?).with("exists.txt").and_return(true)
|
214
219
|
expect(File).to receive(:file?).with("exists.txt").and_return(true)
|
215
220
|
|
216
221
|
provider.releases.map do |release|
|
@@ -234,6 +239,8 @@ describe DPL::Provider::Releases do
|
|
234
239
|
provider.options.update(:file => ["test/foo.bar", "bar.txt"])
|
235
240
|
|
236
241
|
allow(provider).to receive(:releases).and_return([""])
|
242
|
+
expect(File).to receive(:exist?).with("test/foo.bar").and_return(true)
|
243
|
+
expect(File).to receive(:exist?).with("bar.txt").and_return(true)
|
237
244
|
expect(File).to receive(:file?).with("test/foo.bar").and_return(true)
|
238
245
|
expect(File).to receive(:file?).with("bar.txt").and_return(true)
|
239
246
|
|
@@ -263,6 +270,7 @@ describe DPL::Provider::Releases do
|
|
263
270
|
provider.options.update(:release_number => "1234")
|
264
271
|
|
265
272
|
allow(provider).to receive(:slug).and_return("foo/bar")
|
273
|
+
expect(File).to receive(:exist?).with("bar.txt").and_return(true)
|
266
274
|
expect(File).to receive(:file?).with("bar.txt").and_return(true)
|
267
275
|
|
268
276
|
allow(provider.api).to receive(:release_assets).and_return([])
|
@@ -280,6 +288,7 @@ describe DPL::Provider::Releases do
|
|
280
288
|
provider.options.update(:release_number => "1234")
|
281
289
|
provider.options.update(:draft => true)
|
282
290
|
allow(provider).to receive(:slug).and_return("foo/bar")
|
291
|
+
expect(File).to receive(:exist?).with("bar.txt").and_return(true)
|
283
292
|
expect(File).to receive(:file?).with("bar.txt").and_return(true)
|
284
293
|
|
285
294
|
allow(provider.api).to receive(:release_assets).and_return([])
|
@@ -297,6 +306,7 @@ describe DPL::Provider::Releases do
|
|
297
306
|
provider.options.update(:release_number => "1234")
|
298
307
|
provider.options.update(:prerelease => 'true')
|
299
308
|
allow(provider).to receive(:slug).and_return("foo/bar")
|
309
|
+
expect(File).to receive(:exist?).with("bar.txt").and_return(true)
|
300
310
|
expect(File).to receive(:file?).with("bar.txt").and_return(true)
|
301
311
|
|
302
312
|
allow(provider.api).to receive(:release_assets).and_return([])
|
@@ -315,6 +325,7 @@ describe DPL::Provider::Releases do
|
|
315
325
|
provider.options.update(:prerelease => 'true')
|
316
326
|
provider.options.update(:name => 'true')
|
317
327
|
allow(provider).to receive(:slug).and_return("foo/bar")
|
328
|
+
expect(File).to receive(:exist?).with("bar.txt").and_return(true)
|
318
329
|
expect(File).to receive(:file?).with("bar.txt").and_return(true)
|
319
330
|
|
320
331
|
allow(provider.api).to receive(:release_assets).and_return([])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dpl-releases
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.6.travis.
|
4
|
+
version: 1.10.6.travis.3119.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-11-
|
11
|
+
date: 2018-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dpl
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.10.6.travis.
|
19
|
+
version: 1.10.6.travis.3119.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.10.6.travis.
|
26
|
+
version: 1.10.6.travis.3119.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: octokit
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|