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: 8d51ae44fdcb2eb4ce01781ae9c112d19e331c678eddf087af0907aeda972035
4
- data.tar.gz: 1960915e2f76f09aeea0655688e13a639a79d20d9ee74969307b11da5ba71542
3
+ metadata.gz: bcd61940e70a70bbe60de392871389904753e8659b45abba644889172ee99dde
4
+ data.tar.gz: d1278252b7289fd5980db51d6fd6392ecaaaf21990290bb290c6ca7180a367e3
5
5
  SHA512:
6
- metadata.gz: 258ce81e49b7177aade18b043cd21245f24126193236c07d295e077637d4753e9deaedbbd7a05db5676fb11178b4658eb88d7edda2630ea35b9538ddadd44149
7
- data.tar.gz: b45d94f896700da2ccaab3f7d10aff039ad14f067bb1998de7396b5c9e02d14999f7ae2cf379910bf46c899b8a63faf295102d7cf718da15ed6a31545f54674a
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
- other_action.slack(
10
- message: message_text,
11
- success: true,
12
- icon_url: slack_icon,
13
- default_payloads: [:lane, :git_branch, :git_author],
14
- username: "Bemobile Fastlane Plugin - #{ENV["PRIVATE_APP_NAME"]}"
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: :slack_icon,
46
- env_name: "SLACK_ICON",
47
- description: "The user icon to be posted to Slack",
48
- optional: false,
49
- type: String)
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
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Testbm
3
- VERSION = "0.1.13"
3
+ VERSION = "0.1.14"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-testbm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bemobile