fastlane-plugin-apphoster 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 +7 -0
- data/LICENSE +21 -0
- data/README.md +67 -0
- data/lib/fastlane/plugin/apphoster.rb +16 -0
- data/lib/fastlane/plugin/apphoster/actions/apphoster_action.rb +134 -0
- data/lib/fastlane/plugin/apphoster/helper/apphoster_helper.rb +16 -0
- data/lib/fastlane/plugin/apphoster/version.rb +5 -0
- metadata +174 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7a03b8d07e5f19242514cc9997778c814835fe16ce0044e9420a64b1565030bd
|
4
|
+
data.tar.gz: 36d522e4f1811e4aea38b3abb55ea890867c8cd15abd90a954e61591d8341ec9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0fad2f81aa3d4c01aa31b961184f8ca2aa6f4def70d816ff707f95773178bd62d93236d96bdc9124a93923a7c9727133ba4d1065533eb227629717306bfb3efe
|
7
|
+
data.tar.gz: a9990a9b20a336697a22d064a4a95c242449922edd33e9a2e9ac649ed268e87d19918b4cd95d664a45e88a4427371bff9f27606df339925571d978cff39237a5
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 JerryFans <fanjiarong_haohao@163.com>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
# apphoster plugin
|
2
|
+
|
3
|
+
[](https://rubygems.org/gems/fastlane-plugin-apphoster)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-apphoster`, add it to your project by running:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
fastlane add_plugin apphoster
|
11
|
+
```
|
12
|
+
|
13
|
+
## About apphoster
|
14
|
+
|
15
|
+
A simple plugin to upload your ipa file to [app-host](https://github.com/pluosi/app-host) Server in fastlane.
|
16
|
+
|
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
|
+
|
19
|
+
## Example
|
20
|
+
|
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
|
+
|
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
|
39
|
+
|
40
|
+
## Run tests for this plugin
|
41
|
+
|
42
|
+
To run both the tests, and code style validation, run
|
43
|
+
|
44
|
+
```
|
45
|
+
rake
|
46
|
+
```
|
47
|
+
|
48
|
+
To automatically fix many of the styling issues, use
|
49
|
+
```
|
50
|
+
rubocop -a
|
51
|
+
```
|
52
|
+
|
53
|
+
## Issues and Feedback
|
54
|
+
|
55
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
56
|
+
|
57
|
+
## Troubleshooting
|
58
|
+
|
59
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
60
|
+
|
61
|
+
## Using _fastlane_ Plugins
|
62
|
+
|
63
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
64
|
+
|
65
|
+
## About _fastlane_
|
66
|
+
|
67
|
+
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/apphoster/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Apphoster
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::Apphoster.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
@@ -0,0 +1,134 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../helper/apphoster_helper'
|
3
|
+
require 'rest-client'
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
module Fastlane
|
7
|
+
module Actions
|
8
|
+
class ApphosterAction < Action
|
9
|
+
def self.run(params)
|
10
|
+
UI.message("The apphoster plugin is working!")
|
11
|
+
|
12
|
+
api_host = params[:api_host]
|
13
|
+
token = params[:token]
|
14
|
+
plat_id = params[:plat_id]
|
15
|
+
|
16
|
+
build_file = [
|
17
|
+
params[:ipa]
|
18
|
+
].detect { |e| !e.to_s.empty? }
|
19
|
+
|
20
|
+
if build_file.nil?
|
21
|
+
UI.user_error!("You have to provide a build file")
|
22
|
+
end
|
23
|
+
|
24
|
+
UI.message "build_file: #{build_file}"
|
25
|
+
|
26
|
+
file_nick_name = params[:file_nick_name]
|
27
|
+
if file_nick_name.nil?
|
28
|
+
file_nick_name = ""
|
29
|
+
end
|
30
|
+
|
31
|
+
ipa_host = params[:ipa_host]
|
32
|
+
if ipa_host.nil?
|
33
|
+
ipa_host = ""
|
34
|
+
end
|
35
|
+
|
36
|
+
UI.message "Start upload #{build_file} to #{api_host}..."
|
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
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.description
|
66
|
+
"A simple plugin to upload your ipa file to AppHost Server in fastlane."
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.authors
|
70
|
+
["JerryFans"]
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.return_value
|
74
|
+
# If your method provides a return value, you can describe here what it does
|
75
|
+
end
|
76
|
+
|
77
|
+
# def self.details
|
78
|
+
# # Optional:
|
79
|
+
# "A simple plugin to upload your ipa file to AppHost Server in fastlane."
|
80
|
+
# end
|
81
|
+
|
82
|
+
def self.available_options
|
83
|
+
[
|
84
|
+
FastlaneCore::ConfigItem.new(key: :api_host,
|
85
|
+
env_name: "Api_host",
|
86
|
+
description: "Your sever https domain name",
|
87
|
+
optional: false,
|
88
|
+
type: String),
|
89
|
+
FastlaneCore::ConfigItem.new(key: :token,
|
90
|
+
env_name: "Token",
|
91
|
+
description: "Your apphost token",
|
92
|
+
optional: false,
|
93
|
+
type: String),
|
94
|
+
FastlaneCore::ConfigItem.new(key: :plat_id,
|
95
|
+
env_name: "Plat_id",
|
96
|
+
description: "Your apphost plat_id ,identify of your app",
|
97
|
+
optional: false,
|
98
|
+
type: String),
|
99
|
+
FastlaneCore::ConfigItem.new(key: :file_nick_name,
|
100
|
+
env_name: "File_nick_name",
|
101
|
+
description: "Your file nick name",
|
102
|
+
optional: true,
|
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),
|
109
|
+
FastlaneCore::ConfigItem.new(key: :ipa,
|
110
|
+
env_name: "AppHost_IPA",
|
111
|
+
description: "Path to your IPA file",
|
112
|
+
default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
|
113
|
+
optional: true,
|
114
|
+
verify_block: proc do |value|
|
115
|
+
UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value)
|
116
|
+
end,
|
117
|
+
conflicting_options: [:apk],
|
118
|
+
conflict_block: proc do |value|
|
119
|
+
UI.user_error!("You can't use 'ipa' and '#{value.key}' options in one run")
|
120
|
+
end),
|
121
|
+
|
122
|
+
]
|
123
|
+
end
|
124
|
+
|
125
|
+
def self.is_supported?(platform)
|
126
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
127
|
+
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
128
|
+
#
|
129
|
+
# [:ios, :mac, :android].include?(platform)
|
130
|
+
true
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane_core/ui/ui'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
|
5
|
+
|
6
|
+
module Helper
|
7
|
+
class ApphosterHelper
|
8
|
+
# class methods that you define here become available in your action
|
9
|
+
# as `Helper::ApphosterHelper.your_method`
|
10
|
+
#
|
11
|
+
def self.show_message
|
12
|
+
UI.message("Hello from the apphoster plugin helper!")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-apphoster
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- JerryFans
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-12-20 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pry
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec_junit_formatter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.49.1
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.49.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-require_tools
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simplecov
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: fastlane
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 2.137.0
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 2.137.0
|
139
|
+
description:
|
140
|
+
email: fanjiarong_haohao@163.com
|
141
|
+
executables: []
|
142
|
+
extensions: []
|
143
|
+
extra_rdoc_files: []
|
144
|
+
files:
|
145
|
+
- LICENSE
|
146
|
+
- README.md
|
147
|
+
- lib/fastlane/plugin/apphoster.rb
|
148
|
+
- lib/fastlane/plugin/apphoster/actions/apphoster_action.rb
|
149
|
+
- lib/fastlane/plugin/apphoster/helper/apphoster_helper.rb
|
150
|
+
- lib/fastlane/plugin/apphoster/version.rb
|
151
|
+
homepage: https://github.com/JerryFans/fastlane-plugin-apphoster
|
152
|
+
licenses:
|
153
|
+
- MIT
|
154
|
+
metadata: {}
|
155
|
+
post_install_message:
|
156
|
+
rdoc_options: []
|
157
|
+
require_paths:
|
158
|
+
- lib
|
159
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - ">="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
164
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
|
+
requirements:
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: '0'
|
169
|
+
requirements: []
|
170
|
+
rubygems_version: 3.0.3
|
171
|
+
signing_key:
|
172
|
+
specification_version: 4
|
173
|
+
summary: A simple plugin to upload your ipa file to AppHost Server in fastlane.
|
174
|
+
test_files: []
|