fastlane-plugin-firebase_app_distribution 0.1.0 → 0.1.1
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/lib/fastlane/plugin/firebase_app_distribution/actions/firebase_app_distribution_action.rb +14 -23
- data/lib/fastlane/plugin/firebase_app_distribution/helper/firebase_app_distribution_helper.rb +27 -13
- data/lib/fastlane/plugin/firebase_app_distribution/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3322484a56333009e014da42a52738c805177e1343056767b59d6bf92752f511
|
4
|
+
data.tar.gz: d3544fef79f17bae724fa9ced433ab6d5f1b35d98548633c85c16cae9772a585
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39465b098a4d080ace440a5d73363d676497bc544f6563d57fde89e72cd37b8a9111d44ca98815ba633744d41045a13654c7e46c2f8f64e1b60669b7ad3944d4
|
7
|
+
data.tar.gz: 22079d114aa0558ecdb5e670c05eff74faa68b286b15a2ff5eafd5dabfc6837202b023ee93cfc73969c3961178ae404695c1ef031cb01885a878cae60a3c16ef
|
data/lib/fastlane/plugin/firebase_app_distribution/actions/firebase_app_distribution_action.rb
CHANGED
@@ -9,41 +9,34 @@ require_relative '../helper/firebase_app_distribution_helper'
|
|
9
9
|
module Fastlane
|
10
10
|
module Actions
|
11
11
|
class FirebaseAppDistributionAction < Action
|
12
|
-
|
13
|
-
DEFAULT_FIREBASE_CLI_PATH = %x(which firebase).chomp
|
12
|
+
DEFAULT_FIREBASE_CLI_PATH = `which firebase`.chomp
|
14
13
|
FIREBASECMD_ACTION = "appdistribution:distribute".freeze
|
15
|
-
|
14
|
+
|
16
15
|
extend Helper::FirebaseAppDistributionHelper
|
17
16
|
|
18
17
|
def self.run(params)
|
19
18
|
params.values # to validate all inputs before looking for the ipa/apk
|
20
|
-
|
21
|
-
release_file = params[:release_notes_file]
|
22
|
-
if params[:release_notes].to_s != ""
|
23
|
-
release_file = file_for_contents(:release_notes, from: params)
|
24
|
-
end
|
25
|
-
|
26
|
-
groups_file = file_for_contents(:groups, from: params)
|
27
|
-
testers_file = file_for_contents(:testers, from: params)
|
28
19
|
|
29
20
|
cmd = [params[:firebase_cli_path], FIREBASECMD_ACTION]
|
30
21
|
cmd << Shellwords.escape(params[:ipa_path] || params[:apk_path])
|
31
22
|
cmd << "--app #{params[:app]}"
|
32
|
-
cmd << "--groups-file #{groups_file}" if groups_file
|
33
|
-
cmd << "--testers-file #{testers_file}" if testers_file
|
34
|
-
cmd << "--release-notes-file #{release_file}" if release_file
|
35
23
|
|
36
|
-
|
37
|
-
|
24
|
+
cmd << groups_flag(params)
|
25
|
+
cmd << testers_flag(params)
|
26
|
+
cmd << release_notes_flag(params)
|
27
|
+
|
28
|
+
Actions.sh_control_output(
|
29
|
+
cmd.compact.join(" "),
|
38
30
|
print_command: false,
|
39
31
|
print_command_output: true
|
40
32
|
)
|
41
|
-
|
33
|
+
# make sure we do this, even in the case of an error.
|
34
|
+
ensure
|
42
35
|
cleanup_tempfiles
|
43
36
|
end
|
44
37
|
|
45
38
|
def self.description
|
46
|
-
"Release your beta builds
|
39
|
+
"Release your beta builds with Firebase App Distribution"
|
47
40
|
end
|
48
41
|
|
49
42
|
def self.authors
|
@@ -52,7 +45,7 @@ module Fastlane
|
|
52
45
|
|
53
46
|
# supports markdown.
|
54
47
|
def self.details
|
55
|
-
"Release your beta builds
|
48
|
+
"Release your beta builds with Firebase App Distribution"
|
56
49
|
end
|
57
50
|
|
58
51
|
def self.available_options
|
@@ -105,7 +98,7 @@ module Fastlane
|
|
105
98
|
end
|
106
99
|
|
107
100
|
unless is_firebasecmd_supported?(value)
|
108
|
-
|
101
|
+
UI.user_error!("firebase_cli_path: `#{value}` does not support the `#{FIREBASECMD_ACTION}` command. Please download (https://appdistro.page.link/firebase-cli-download) or specify the path to the correct version of firebse")
|
109
102
|
end
|
110
103
|
end),
|
111
104
|
FastlaneCore::ConfigItem.new(key: :groups,
|
@@ -139,7 +132,7 @@ module Fastlane
|
|
139
132
|
env_name: "FIREBASEAPPDISTRO_RELEASE_NOTES_FILE",
|
140
133
|
description: "Release notes file for this build",
|
141
134
|
optional: true,
|
142
|
-
type: String)
|
135
|
+
type: String)
|
143
136
|
]
|
144
137
|
end
|
145
138
|
|
@@ -162,8 +155,6 @@ module Fastlane
|
|
162
155
|
]
|
163
156
|
end
|
164
157
|
|
165
|
-
private
|
166
|
-
|
167
158
|
## TODO: figure out if we can surpress color output.
|
168
159
|
def self.is_firebasecmd_supported?(cmd)
|
169
160
|
outerr, status = Open3.capture2e(cmd, "--non-interactive", FIREBASECMD_ACTION, "--help")
|
data/lib/fastlane/plugin/firebase_app_distribution/helper/firebase_app_distribution_helper.rb
CHANGED
@@ -5,35 +5,49 @@ module Fastlane
|
|
5
5
|
|
6
6
|
module Helper
|
7
7
|
module FirebaseAppDistributionHelper
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
def testers_flag(params)
|
9
|
+
file_flag_if_supplied("--testers-file", "testers", params)
|
10
|
+
end
|
11
|
+
|
12
|
+
def groups_flag(params)
|
13
|
+
file_flag_if_supplied("--groups-file", "groups", params)
|
14
|
+
end
|
15
|
+
|
16
|
+
def release_notes_flag(params)
|
17
|
+
file_flag_if_supplied("--release-notes-file", "release_notes", params)
|
18
|
+
end
|
19
|
+
|
20
|
+
def file_flag_if_supplied(flag, param_name, params)
|
21
|
+
file = params["#{param_name}_file".to_sym]
|
22
|
+
file ||= file_for_contents(param_name.to_sym, params)
|
23
|
+
|
24
|
+
if file
|
25
|
+
return "--#{flag} #{file}"
|
14
26
|
end
|
27
|
+
end
|
15
28
|
|
16
|
-
|
29
|
+
##
|
30
|
+
# always return a file for a given content
|
31
|
+
def file_for_contents(parameter_name, params)
|
32
|
+
if @tempfiles.nil?
|
17
33
|
@tempfiles = []
|
18
34
|
end
|
19
35
|
|
20
|
-
contents
|
36
|
+
contents = params[parameter_name]
|
21
37
|
return nil if contents.nil?
|
22
38
|
|
23
39
|
file = Tempfile.new(parameter_name.to_s)
|
24
40
|
file.write(contents)
|
25
41
|
file.close
|
26
42
|
@tempfiles << file
|
27
|
-
|
43
|
+
|
28
44
|
file.path
|
29
45
|
end
|
30
46
|
|
31
47
|
def cleanup_tempfiles
|
32
|
-
@tempfiles.
|
33
|
-
|
34
|
-
end
|
48
|
+
return if @tempfiles.nil?
|
49
|
+
@tempfiles.each(&:unlink)
|
35
50
|
end
|
36
|
-
|
37
51
|
end
|
38
52
|
end
|
39
53
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-firebase_app_distribution
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Natchev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|