fastlane-plugin-testbm 0.1.10 → 0.1.15

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: 6540016f53662b498131abd58fdf25bc456d70245514bd31d74ed737af3387bb
4
- data.tar.gz: b4596467e5739633a676f4417952dae65d2da3ba298c4ad98a15d0d4d7d6fafe
3
+ metadata.gz: d7a73bcd0e62fa3734a5a7780a5e34eebedc2e00134b8b93e14578f6d3784ed1
4
+ data.tar.gz: 9ac56da580fa021a92f4995c3f0afd203df558193e556268eb540f62cd5c6191
5
5
  SHA512:
6
- metadata.gz: d0a60040b935f80843f029e90f448b0f61bc20d133ca204daa060d667316b7bcfb15a301375047a60316303baab0ea1d15c005c672c6a58124d991bf634ff407
7
- data.tar.gz: f875741c7b66c30832842220056b5c198600a2f876835b6c6296f531323f92d5312395c16ac40e9408bebf41bc993334af9fe865450c81d2772c7f094b05b953
6
+ metadata.gz: 07e1b9292a96f1558a646e45e975d27308c1490df0dacd0b80baf19c2587f5b21300d5bbbf7989759a871739e150d323f75e79460e55410d94d5c446b241e765
7
+ data.tar.gz: 6cf611a62b7f7c91f97097d1d2de9b107ef3ddd66368d2c94b9c61158db1c10db7873798b288e89a6186e9339e6168a35faf2a760a656fcb68ab51eedea00634
@@ -0,0 +1,84 @@
1
+ require 'fastlane/action'
2
+
3
+ module Fastlane
4
+ module Actions
5
+ class BmslackAction < Action
6
+ def self.run(params)
7
+ message_text = params[:message_text]
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
14
+ UI.message("Message sent to Slack!")
15
+ end
16
+
17
+ def self.description
18
+ "Sends a message to a Slack chat specified in the SLACK_URL environment variable"
19
+ end
20
+
21
+ def self.authors
22
+ ["Erick, Legna @ Bemobile"]
23
+ end
24
+
25
+ def self.return_value
26
+ # If your method provides a return value, you can describe here what it does
27
+ end
28
+
29
+ def self.details
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.
32
+ An icon must be specified as a param named slack_icon, or as an environment variable named SLACK_ICON.
33
+ The webhook URL must be specified as an environment variable called SLACK_URL.
34
+ The username which sends the message can be appendend with the environment variable called PRIVATE_APP_NAME."
35
+ end
36
+
37
+ def self.available_options
38
+ [
39
+ FastlaneCore::ConfigItem.new(key: :message_text,
40
+ env_name: "MESSAGE_TEXT",
41
+ description: "The chat message to be sent to Slack",
42
+ optional: false,
43
+ 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)
49
+ ]
50
+ end
51
+
52
+ def self.is_supported?(platform)
53
+ true
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
+
82
+ end
83
+ end
84
+ end
@@ -13,7 +13,7 @@ module Fastlane
13
13
  end
14
14
 
15
15
  #Notify via slack channel a generic message with the default payloads
16
- def slack_func_notify(message_text:)
16
+ def self.slack_func_notify(message_text)
17
17
  other_action.slack(
18
18
  message: message_text,
19
19
  success: true,
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Testbm
3
- VERSION = "0.1.10"
3
+ VERSION = "0.1.15"
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.10
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bemobile
@@ -145,7 +145,7 @@ files:
145
145
  - LICENSE
146
146
  - README.md
147
147
  - lib/fastlane/plugin/testbm.rb
148
- - lib/fastlane/plugin/testbm/actions/chat_action.rb
148
+ - lib/fastlane/plugin/testbm/actions/bmslack_action.rb
149
149
  - lib/fastlane/plugin/testbm/actions/salutation_action.rb
150
150
  - lib/fastlane/plugin/testbm/actions/testbm_action.rb
151
151
  - lib/fastlane/plugin/testbm/helper/testbm_helper.rb
@@ -1,61 +0,0 @@
1
- require 'fastlane/action'
2
- require_relative '../helper/testbm_helper'
3
-
4
- module Fastlane
5
- module Actions
6
- class ChatAction < Action
7
- def self.run(params)
8
- slack_icon = params[:slack_icon]
9
- message_text = params[:message_text]
10
- other_action.slack(
11
- message: message_text,
12
- success: true,
13
- icon_url: slack_icon,
14
- username: "Bemobile Fastlane Plugin - #{ENV["PRIVATE_APP_NAME"]}"
15
- )
16
- Helper::TestbmHelper.slack_func_notify("Message from")
17
- UI.message("Message sent to Slack!")
18
- end
19
-
20
- def self.description
21
- "Returns hello world"
22
- end
23
-
24
- def self.authors
25
- ["Bemobile"]
26
- end
27
-
28
- def self.return_value
29
- # If your method provides a return value, you can describe here what it does
30
- end
31
-
32
- def self.details
33
- # Optional:
34
- "Just a test plugin"
35
- end
36
-
37
- def self.available_options
38
- [
39
- FastlaneCore::ConfigItem.new(key: :message_text,
40
- env_name: "MESSAGE_TEXT",
41
- description: "The chat message to be sent to Slack",
42
- optional: false,
43
- type: String),
44
- FastlaneCore::ConfigItem.new(key: :slack_icon,
45
- env_name: "SLACK_ICON",
46
- description: "The icon to be posted to Slack",
47
- optional: false,
48
- type: String)
49
- ]
50
- end
51
-
52
- def self.is_supported?(platform)
53
- # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
54
- # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
55
- #
56
- # [:ios, :mac, :android].include?(platform)
57
- true
58
- end
59
- end
60
- end
61
- end