fastlane-plugin-apphoster 1.0.0 → 1.1.0
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/README.md +18 -3
- data/lib/fastlane/plugin/apphoster/actions/apphoster_action.rb +36 -12
- data/lib/fastlane/plugin/apphoster/version.rb +1 -1
- 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: 7a03b8d07e5f19242514cc9997778c814835fe16ce0044e9420a64b1565030bd
|
4
|
+
data.tar.gz: 36d522e4f1811e4aea38b3abb55ea890867c8cd15abd90a954e61591d8341ec9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fad2f81aa3d4c01aa31b961184f8ca2aa6f4def70d816ff707f95773178bd62d93236d96bdc9124a93923a7c9727133ba4d1065533eb227629717306bfb3efe
|
7
|
+
data.tar.gz: a9990a9b20a336697a22d064a4a95c242449922edd33e9a2e9ac649ed268e87d19918b4cd95d664a45e88a4427371bff9f27606df339925571d978cff39237a5
|
data/README.md
CHANGED
@@ -12,15 +12,30 @@ fastlane add_plugin apphoster
|
|
12
12
|
|
13
13
|
## About apphoster
|
14
14
|
|
15
|
-
A simple plugin to upload your ipa file to
|
15
|
+
A simple plugin to upload your ipa file to [app-host](https://github.com/pluosi/app-host) Server in fastlane.
|
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
|
|
19
19
|
## Example
|
20
20
|
|
21
|
-
|
21
|
+
if youur project use fastlane to build ipa file (just supported iOS file now) , and use app-host sever to upload ipa file to install app.
|
22
22
|
|
23
|
-
|
23
|
+
```
|
24
|
+
fastlane add_plugin apphoster
|
25
|
+
```
|
26
|
+
|
27
|
+
```
|
28
|
+
lane :beta do
|
29
|
+
build_app(export_method: "ad-hoc")
|
30
|
+
apphoster(api_host: "https://xxx.com, token: "your app-host token", plat_id: "your plat_id")
|
31
|
+
end
|
32
|
+
```
|
33
|
+
|
34
|
+
```
|
35
|
+
fastlane beta
|
36
|
+
```
|
37
|
+
|
38
|
+
now you can auto build a ad-hoc ipa file and auto upload to app-host sever
|
24
39
|
|
25
40
|
## Run tests for this plugin
|
26
41
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'fastlane/action'
|
2
2
|
require_relative '../helper/apphoster_helper'
|
3
|
+
require 'rest-client'
|
4
|
+
require 'json'
|
3
5
|
|
4
6
|
module Fastlane
|
5
7
|
module Actions
|
@@ -25,21 +27,38 @@ module Fastlane
|
|
25
27
|
if file_nick_name.nil?
|
26
28
|
file_nick_name = ""
|
27
29
|
end
|
28
|
-
|
29
|
-
|
30
|
-
if
|
31
|
-
|
30
|
+
|
31
|
+
ipa_host = params[:ipa_host]
|
32
|
+
if ipa_host.nil?
|
33
|
+
ipa_host = ""
|
32
34
|
end
|
33
35
|
|
34
|
-
UI.message "Begin run script #{run_script}"
|
35
36
|
UI.message "Start upload #{build_file} to #{api_host}..."
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
|
38
|
+
response = RestClient::Request.execute(
|
39
|
+
method: :post,
|
40
|
+
url: url,
|
41
|
+
payload: {
|
42
|
+
token: token,
|
43
|
+
plat_id: plat_id,
|
44
|
+
:multipart => true,
|
45
|
+
:file => File.new(build_file, 'rb')
|
46
|
+
},
|
47
|
+
)
|
48
|
+
json = JSON.parse(response.body)
|
49
|
+
error = json["error"]
|
50
|
+
if error.nil?
|
51
|
+
ipa_id = json["id"]
|
52
|
+
name = json["name"]
|
53
|
+
install_url = "#{ipa_host}#{ipa_id}"
|
54
|
+
if ipa_host.empty?
|
55
|
+
UI.success "#{name} upload success install ipa_id is #{ipa_id}"
|
56
|
+
else
|
57
|
+
UI.success "#{name} upload success install url is #{install_url}"
|
58
|
+
end
|
59
|
+
else
|
60
|
+
UI.user_error!("upload error : #{json["error"]}")
|
61
|
+
end
|
43
62
|
|
44
63
|
end
|
45
64
|
|
@@ -82,6 +101,11 @@ module Fastlane
|
|
82
101
|
description: "Your file nick name",
|
83
102
|
optional: true,
|
84
103
|
type: String),
|
104
|
+
FastlaneCore::ConfigItem.new(key: :ipa_host,
|
105
|
+
env_name: "Ipa_host",
|
106
|
+
description: "ipa host to replace like xxx.com/ipa/pkgs/100 that is your install url",
|
107
|
+
optional: true,
|
108
|
+
type: String),
|
85
109
|
FastlaneCore::ConfigItem.new(key: :ipa,
|
86
110
|
env_name: "AppHost_IPA",
|
87
111
|
description: "Path to your IPA file",
|