fastlane-plugin-testbm 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcd61940e70a70bbe60de392871389904753e8659b45abba644889172ee99dde
|
4
|
+
data.tar.gz: d1278252b7289fd5980db51d6fd6392ecaaaf21990290bb290c6ca7180a367e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8469fb0657b04596fa56d3efcf0fbe5d5928cfa89d679b81327b0fb23c5e945962ee332ba1a7d457b913a17999381312d71d117fd51cfd849be9bc4c5592bf01
|
7
|
+
data.tar.gz: 20482981e3d50681ef0dcf87f57301e2358326ad5bbe1715b3a7131615ee673b3f60a7fbe61be0a3a862fbe71411ae31a2c2c1df0d10db9be8ee9fc20fb56cf5
|
@@ -4,15 +4,13 @@ module Fastlane
|
|
4
4
|
module Actions
|
5
5
|
class BmslackAction < Action
|
6
6
|
def self.run(params)
|
7
|
-
slack_icon = params[:slack_icon]
|
8
7
|
message_text = params[:message_text]
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
)
|
8
|
+
is_exception = params[:is_exception]
|
9
|
+
if is_exception
|
10
|
+
self.slack_func_notify(message_text)
|
11
|
+
else
|
12
|
+
self.slack_func_notify_error_in_lane(message_text)
|
13
|
+
end
|
16
14
|
UI.message("Message sent to Slack!")
|
17
15
|
end
|
18
16
|
|
@@ -30,6 +28,7 @@ module Fastlane
|
|
30
28
|
|
31
29
|
def self.details
|
32
30
|
"Sends a message to a Slack webhook. The message must be passed to the function as a parameter named message_text.
|
31
|
+
To specify that the message comes from an exception or not, we must pass the is_exception parameter.
|
33
32
|
An icon must be specified as a param named slack_icon, or as an environment variable named SLACK_ICON.
|
34
33
|
The webhook URL must be specified as an environment variable called SLACK_URL.
|
35
34
|
The username which sends the message can be appendend with the environment variable called PRIVATE_APP_NAME."
|
@@ -42,17 +41,44 @@ module Fastlane
|
|
42
41
|
description: "The chat message to be sent to Slack",
|
43
42
|
optional: false,
|
44
43
|
type: String),
|
45
|
-
FastlaneCore::ConfigItem.new(key: :
|
46
|
-
|
47
|
-
description: "
|
48
|
-
|
49
|
-
|
44
|
+
FastlaneCore::ConfigItem.new(key: :is_exception,
|
45
|
+
env_name: "IS_EXCEPTION",
|
46
|
+
description: "Flag that indicates if the message is from an exception.",
|
47
|
+
optional: false,
|
48
|
+
type: Boolean)
|
50
49
|
]
|
51
50
|
end
|
52
51
|
|
53
52
|
def self.is_supported?(platform)
|
54
53
|
true
|
55
54
|
end
|
55
|
+
|
56
|
+
def self.slack_func_notify(message_text)
|
57
|
+
other_action.slack(
|
58
|
+
message: message_text,
|
59
|
+
success: true,
|
60
|
+
default_payloads: [:lane, :git_branch, :git_author],
|
61
|
+
icon_url: ENV["SLACK_ICON"],
|
62
|
+
username: "Bemobile Fastlane Plugin - #{ENV["PRIVATE_APP_NAME"]}")
|
63
|
+
end
|
64
|
+
|
65
|
+
|
66
|
+
#Notify an error of the lane and show the error that fastlane has
|
67
|
+
def slack_func_notify_error_in_lane(message_text)
|
68
|
+
payload = {
|
69
|
+
"Build Date" => Time.new.to_s,
|
70
|
+
"Error Message" => message_text
|
71
|
+
}
|
72
|
+
|
73
|
+
other_action.slack(
|
74
|
+
message: "#{ENV["PRIVATE_APP_NAME"]} App build stop with error",
|
75
|
+
success: false,
|
76
|
+
icon_url: ENV["SLACK_ICON"],
|
77
|
+
username: "Bemobile Fastlane Plugin - #{ENV["PRIVATE_APP_NAME"]}",
|
78
|
+
payload: payload)
|
79
|
+
|
80
|
+
end
|
81
|
+
|
56
82
|
end
|
57
83
|
end
|
58
84
|
end
|