fastlane-plugin-latest_hockey_build_number 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +46 -0
- data/lib/fastlane/plugin/latest_hockey_build_number.rb +16 -0
- data/lib/fastlane/plugin/latest_hockey_build_number/actions/latest_hockey_build_number_action.rb +70 -0
- data/lib/fastlane/plugin/latest_hockey_build_number/helper/latest_hockey_build_number_helper.rb +12 -0
- data/lib/fastlane/plugin/latest_hockey_build_number/version.rb +5 -0
- metadata +136 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5854bf6b56e3d6586ae73ddc659097191ca446d9
|
4
|
+
data.tar.gz: f3ea2f14115138baf16418ae8fce48d4c3ff0169
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: da4e68da71cf9ab1dd8a9c87a98af2f4dd807b4ba8360ab0508cae01e3813343abe2a5b505158a06212be816703b147fe6d800750788d64cafd571b2af4ddcf3
|
7
|
+
data.tar.gz: d3a425aa7204b4f7cb612653e7e48527dccfe8628d42b9cf554a7f85f4fd02761e98664b29882841908c90d23ce6514f7ebafd0993d40ba3afd132f22e667e69
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Kirill Pahnev <kirill.pahnev@gmail.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,46 @@
|
|
1
|
+
# latest_hockey_build_number plugin
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-latest_hockey_build_number)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-latest_hockey_build_number`, add it to your project by running:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
fastlane add_plugin latest_hockey_build_number
|
11
|
+
```
|
12
|
+
|
13
|
+
Once you've added the plugin, add the latest_hockey_build_number action to your Fastfile. Like this:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
platform :ios do
|
17
|
+
beta do
|
18
|
+
version_number = latest_hockey_build_number
|
19
|
+
end
|
20
|
+
end
|
21
|
+
```
|
22
|
+
|
23
|
+
|
24
|
+
## About latest_hockey_build_number
|
25
|
+
|
26
|
+
Gets latest version number of the app with the bundle id from HockeyApp. Special thanks to [nikolaykasyanov](https://github.com/nikolaykasyanov) who published the [gist](https://gist.github.com/nikolaykasyanov/fa9f727a2659450f49825a238546ea8b).
|
27
|
+
|
28
|
+
## Example
|
29
|
+
|
30
|
+
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
31
|
+
|
32
|
+
## Issues and Feedback
|
33
|
+
|
34
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
35
|
+
|
36
|
+
## Troubleshooting
|
37
|
+
|
38
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/PluginsTroubleshooting.md) doc in the main `fastlane` repo.
|
39
|
+
|
40
|
+
## Using `fastlane` Plugins
|
41
|
+
|
42
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Plugins.md).
|
43
|
+
|
44
|
+
## About `fastlane`
|
45
|
+
|
46
|
+
`fastlane` is the easiest way to automate building and releasing your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/latest_hockey_build_number/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module LatestHockeyBuildNumber
|
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::LatestHockeyBuildNumber.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
data/lib/fastlane/plugin/latest_hockey_build_number/actions/latest_hockey_build_number_action.rb
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'net/http'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
class LatestHockeyBuildNumberAction < Action
|
7
|
+
def self.run(config)
|
8
|
+
host_uri = URI.parse('https://rink.hockeyapp.net')
|
9
|
+
http = Net::HTTP.new(host_uri.host, host_uri.port)
|
10
|
+
http.use_ssl = true
|
11
|
+
list_request = Net::HTTP::Get.new('/api/2/apps')
|
12
|
+
list_request['X-HockeyAppToken'] = config[:api_token]
|
13
|
+
list_response = http.request(list_request)
|
14
|
+
app_list = JSON.parse(list_response.body)['apps']
|
15
|
+
|
16
|
+
app = app_list.find { |app| app['bundle_identifier'] == config[:bundle_id] }
|
17
|
+
|
18
|
+
if app.nil?
|
19
|
+
UI.error "No application with bundle id #{config[:bundle_id]}"
|
20
|
+
return nil
|
21
|
+
end
|
22
|
+
|
23
|
+
app_identifier = app['public_identifier']
|
24
|
+
|
25
|
+
details_request = Net::HTTP::Get.new("/api/2/apps/#{app_identifier}/app_versions?page=1")
|
26
|
+
details_request['X-HockeyAppToken'] = config[:api_token]
|
27
|
+
details_response = http.request(details_request)
|
28
|
+
|
29
|
+
app_details = JSON.parse(details_response.body)
|
30
|
+
latest_build = app_details['app_versions'].find{ |version| version['status'] != -1 }
|
31
|
+
|
32
|
+
if latest_build.nil?
|
33
|
+
UI.error "The app has no versions yet"
|
34
|
+
return nil
|
35
|
+
end
|
36
|
+
|
37
|
+
return latest_build['version']
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.description
|
41
|
+
"Gets latest version number of the app with the bundle id from HockeyApp"
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.authors
|
45
|
+
["pahnev", "FlixBus (original author)"]
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.available_options
|
49
|
+
[
|
50
|
+
FastlaneCore::ConfigItem.new(key: :api_token,
|
51
|
+
env_name: "FL_HOCKEY_API_TOKEN",
|
52
|
+
description: "API Token for Hockey Access",
|
53
|
+
verify_block: proc do |value|
|
54
|
+
UI.user_error!("No API token for Hockey given, pass using `api_token: 'token'`") unless value and !value.empty?
|
55
|
+
end),
|
56
|
+
FastlaneCore::ConfigItem.new(key: :bundle_id,
|
57
|
+
env_name: "FL_HOCKEY_BUNDLE_ID",
|
58
|
+
description: "Bundle ID of the application",
|
59
|
+
verify_block: proc do |value|
|
60
|
+
UI.user_error!("No bundle ID for Hockey given, pass using `bundle_id: 'bundle id'`") unless value and !value.empty?
|
61
|
+
end),
|
62
|
+
]
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.is_supported?(platform)
|
66
|
+
[:ios, :android].include? platform
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
data/lib/fastlane/plugin/latest_hockey_build_number/helper/latest_hockey_build_number_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Helper
|
3
|
+
class LatestHockeyBuildNumberHelper
|
4
|
+
# class methods that you define here become available in your action
|
5
|
+
# as `Helper::LatestHockeyBuildNumberHelper.your_method`
|
6
|
+
#
|
7
|
+
def self.show_message
|
8
|
+
UI.message("Hello from the latest_hockey_build_number plugin helper!")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-latest_hockey_build_number
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Sergii Stotskyi
|
8
|
+
- Kirill Pahnev
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2016-10-17 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: pry
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: bundler
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rspec
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rake
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rubocop
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: fastlane
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 1.103.0
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 1.103.0
|
98
|
+
description:
|
99
|
+
email:
|
100
|
+
- sergiy.stotskiy@gmail.com
|
101
|
+
- kirill.pahnev@gmail.com
|
102
|
+
executables: []
|
103
|
+
extensions: []
|
104
|
+
extra_rdoc_files: []
|
105
|
+
files:
|
106
|
+
- LICENSE
|
107
|
+
- README.md
|
108
|
+
- lib/fastlane/plugin/latest_hockey_build_number.rb
|
109
|
+
- lib/fastlane/plugin/latest_hockey_build_number/actions/latest_hockey_build_number_action.rb
|
110
|
+
- lib/fastlane/plugin/latest_hockey_build_number/helper/latest_hockey_build_number_helper.rb
|
111
|
+
- lib/fastlane/plugin/latest_hockey_build_number/version.rb
|
112
|
+
homepage: https://github.com/stalniy/fastlane-plugin-latest_hockey_build_number
|
113
|
+
licenses:
|
114
|
+
- MIT
|
115
|
+
metadata: {}
|
116
|
+
post_install_message:
|
117
|
+
rdoc_options: []
|
118
|
+
require_paths:
|
119
|
+
- lib
|
120
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0'
|
130
|
+
requirements: []
|
131
|
+
rubyforge_project:
|
132
|
+
rubygems_version: 2.5.1
|
133
|
+
signing_key:
|
134
|
+
specification_version: 4
|
135
|
+
summary: Gets latest version number of the app with the bundle id from HockeyApp
|
136
|
+
test_files: []
|