fastlane-plugin-mobile_center 0.1.2 → 0.1.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6b928d0dcb6737f976da5100c27d6c0b3095962
|
4
|
+
data.tar.gz: 93905991834fc81f357649a3e9112b3c4a395c12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc6a47bd323e5a681fe8305780fc930612900c92dfa866df5f67736f32339b348ffcd38ff5705c4d5f72b558e549e12dd7d9a444afe9c31f8b286d373aef4ff9
|
7
|
+
data.tar.gz: b7dd94584d050b8aa3ad7dc25a7f62bc5c02b6171866eef3d521ba3106702ee158d94290b0e769a81f9a99f151c414cc54b83a9c7c6362f56e809cb3fa669802
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# mobile_center plugin
|
2
2
|
|
3
3
|
[](https://rubygems.org/gems/fastlane-plugin-mobile_center)
|
4
|
+
[](https://badge.fury.io/rb/fastlane-plugin-mobile_center)
|
5
|
+
[](https://travis-ci.org/Microsoft/mobile-center-plugin-fastlane)
|
4
6
|
|
5
7
|
## Getting Started
|
6
8
|
|
@@ -304,12 +304,87 @@ module Fastlane
|
|
304
304
|
end
|
305
305
|
end
|
306
306
|
|
307
|
+
# returns true if app exists, false in case of 404 and error otherwise
|
308
|
+
def self.get_app(api_token, owner_name, app_name)
|
309
|
+
connection = self.connection
|
310
|
+
|
311
|
+
response = connection.get do |req|
|
312
|
+
req.url("/v0.1/apps/#{owner_name}/#{app_name}")
|
313
|
+
req.headers['X-API-Token'] = api_token
|
314
|
+
req.headers['internal-request-source'] = "fastlane"
|
315
|
+
end
|
316
|
+
|
317
|
+
case response.status
|
318
|
+
when 200...300
|
319
|
+
UI.message("DEBUG: #{JSON.pretty_generate(response.body)}\n") if ENV['DEBUG']
|
320
|
+
true
|
321
|
+
when 404
|
322
|
+
UI.message("DEBUG: #{JSON.pretty_generate(response.body)}\n") if ENV['DEBUG']
|
323
|
+
false
|
324
|
+
else
|
325
|
+
UI.error("Error #{response.status}: #{response.body}")
|
326
|
+
false
|
327
|
+
end
|
328
|
+
end
|
329
|
+
|
330
|
+
# checks app existance, if ther is no such - creates it
|
331
|
+
def self.get_or_create_app(params)
|
332
|
+
api_token = params[:api_token]
|
333
|
+
owner_name = params[:owner_name]
|
334
|
+
app_name = params[:app_name]
|
335
|
+
|
336
|
+
platforms = {
|
337
|
+
"Android" => ['Java', 'React-Native', 'Xamarin'],
|
338
|
+
"iOS" => ['Objective-C-Swift', 'React-Native', 'Xamarin']
|
339
|
+
}
|
340
|
+
|
341
|
+
if self.get_app(api_token, owner_name, app_name)
|
342
|
+
true
|
343
|
+
else
|
344
|
+
if Helper.test? || UI.confirm("App with name #{app_name} not found, create one?")
|
345
|
+
connection = self.connection
|
346
|
+
|
347
|
+
os = Helper.test? ? "Android" : UI.select("Select OS", ["Android", "iOS"])
|
348
|
+
platform = Helper.test? ? "Java" : UI.select("Select Platform", platforms[os])
|
349
|
+
|
350
|
+
response = connection.post do |req|
|
351
|
+
req.url("/v0.1/apps")
|
352
|
+
req.headers['X-API-Token'] = api_token
|
353
|
+
req.headers['internal-request-source'] = "fastlane"
|
354
|
+
req.body = {
|
355
|
+
"display_name" => app_name,
|
356
|
+
"name" => app_name,
|
357
|
+
"os" => os,
|
358
|
+
"platform" => platform
|
359
|
+
}
|
360
|
+
end
|
361
|
+
|
362
|
+
case response.status
|
363
|
+
when 200...300
|
364
|
+
created = response.body
|
365
|
+
UI.message("DEBUG: #{JSON.pretty_generate(created)}") if ENV['DEBUG']
|
366
|
+
UI.success("Created #{os}/#{platform} app with name \"#{created['name']}\"")
|
367
|
+
true
|
368
|
+
else
|
369
|
+
UI.error("Error creating app #{response.status}: #{response.body}")
|
370
|
+
false
|
371
|
+
end
|
372
|
+
else
|
373
|
+
UI.error("Lane aborted")
|
374
|
+
false
|
375
|
+
end
|
376
|
+
end
|
377
|
+
end
|
378
|
+
|
307
379
|
def self.run(params)
|
308
380
|
values = params.values
|
309
381
|
upload_dsym_only = params[:upload_dsym_only]
|
310
382
|
|
311
|
-
|
312
|
-
self.
|
383
|
+
# if app found or successfully created
|
384
|
+
if self.get_or_create_app(params)
|
385
|
+
self.run_release_upload(params) unless upload_dsym_only
|
386
|
+
self.run_dsym_upload(params)
|
387
|
+
end
|
313
388
|
|
314
389
|
return values if Helper.test?
|
315
390
|
end
|
@@ -350,7 +425,7 @@ module Fastlane
|
|
350
425
|
|
351
426
|
FastlaneCore::ConfigItem.new(key: :app_name,
|
352
427
|
env_name: "MOBILE_CENTER_APP_NAME",
|
353
|
-
description: "App name",
|
428
|
+
description: "App name. If there is no app with such name, you will be prompted to create one",
|
354
429
|
optional: false,
|
355
430
|
type: String,
|
356
431
|
verify_block: proc do |value|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-mobile_center
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Microsoft Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 2.
|
89
|
+
version: 2.29.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 2.
|
96
|
+
version: 2.29.0
|
97
97
|
description:
|
98
98
|
email:
|
99
99
|
executables: []
|