fastlane-plugin-upload_to_server 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: fd669848a4b087688e5e4e3e1ea52eb90cc88e3b
4
- data.tar.gz: ca869e72f02f1fb3edcfebe7ee922bdf71b6c8ed
3
+ metadata.gz: 4fbc80cb039268b2298500f8364b91ac34a11192
4
+ data.tar.gz: 97dde2e8645fe262d44028bcbfa105c41fb3d87c
5
5
  SHA512:
6
- metadata.gz: b0c4cf7d40aa0a39e78d2fae56e085927da8faa0a484db93a66847c3e897bd0428d2b7bcf8a02869598495bda1ed2edd893207cfa2225f5636d157950563f1a0
7
- data.tar.gz: 257433392aa0eeba0d6a2a221353c1cf7e927baa1ef6b268334fbafe73d94a4b36957e678841c0be71aa41616197a01df9623d3d322dbae2d0f52411b8242f08
6
+ metadata.gz: 6c21ab5843fd9e45aba872b9bc7e0f2e5c6d37c84dc621f4ac798adcadbd6a792dd544936f4e257494c24c4464066a8988475d2f1458089b729f3247ae32a36f
7
+ data.tar.gz: 72f649174f75418230230194840dcdd13e2c9f6801e813fe28bc01138db2c76e6d4e83f8340c2278e22648d52a457dea433730daf6262764e7811ac0b66d6d92
data/README.md CHANGED
@@ -12,7 +12,7 @@ fastlane add_plugin upload_to_server
12
12
 
13
13
  ## About upload_to_server
14
14
 
15
- Upload IPA and APK to your own server,and other multipart data parameters.
15
+ Upload IPA and APK or a File to your own server,and other multipart data parameters.
16
16
 
17
17
  **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
18
18
 
@@ -39,6 +39,7 @@ upload_to_server(
39
39
  },
40
40
  ipa: 'path to your apk', #(Optional - will be taken from the gym step)
41
41
  apk: 'path to your ipa', #(Optional - will be taken from the gradle step)
42
+ file: 'path to your custom file'
42
43
  )
43
44
 
44
45
  example of uploading an apk to a private server:
@@ -11,19 +11,34 @@ module Fastlane
11
11
  params[:endPoint] = config[:endPoint]
12
12
  params[:apk] = config[:apk]
13
13
  params[:ipa] = config[:ipa]
14
+ params[:file] = config[:file]
15
+
14
16
  params[:multipartPayload] = config[:multipartPayload]
15
17
  params[:headers] = config[:headers]
16
18
 
17
19
  apk_file = params[:apk]
18
20
  ipa_file = params[:ipa]
21
+ custom_file = params[:file]
22
+
19
23
  end_point = params[:endPoint]
20
24
 
21
25
  UI.user_error!("No endPoint given, pass using endPoint: 'endpoint'") if end_point.to_s.length == 0 && end_point.to_s.length == 0
22
- UI.user_error!("No IPA or APK file path given, pass using `ipa: 'ipa path'` or `apk: 'apk path'`") if ipa_file.to_s.length == 0 && apk_file.to_s.length == 0
26
+ UI.user_error!("No IPA or APK or a file path given, pass using `ipa: 'ipa path'` or `apk: 'apk path' or file:`") if ipa_file.to_s.length == 0 && apk_file.to_s.length == 0 && custom_file.to_s.length == 0
23
27
  UI.user_error!("Please only give IPA path or APK path (not both)") if ipa_file.to_s.length > 0 && apk_file.to_s.length > 0
24
28
 
25
29
  upload_apk(params, apk_file) if apk_file.to_s.length > 0
26
30
  upload_ipa(params, ipa_file) if ipa_file.to_s.length > 0
31
+ upload_custom_file(params, custom_file) if custom_file.to_s.length > 0
32
+
33
+ end
34
+
35
+ def self.upload_custom_file(params, custom_file)
36
+ multipart_payload = params[:multipartPayload]
37
+
38
+ multipart_payload[:multipart] = true
39
+ multipart_payload[:file] = File.new(params[:file], 'rb')
40
+
41
+ upload_file(params, multipart_payload)
27
42
  end
28
43
 
29
44
  def self.upload_apk(params, apk_file)
@@ -49,7 +64,8 @@ module Fastlane
49
64
  method: :post,
50
65
  url: params[:endPoint],
51
66
  payload: multipart_payload,
52
- headers: params[:headers]
67
+ headers: params[:headers],
68
+ log: Logger.new(STDOUT)
53
69
  )
54
70
 
55
71
  response = request.execute
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module UploadToServer
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-upload_to_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxim Toyberman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-22 00:00:00.000000000 Z
11
+ date: 2019-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -182,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  version: '0'
183
183
  requirements: []
184
184
  rubyforge_project:
185
- rubygems_version: 2.5.1
185
+ rubygems_version: 2.5.2.3
186
186
  signing_key:
187
187
  specification_version: 4
188
188
  summary: Upload IPA and APK to your own server