fastlane-plugin-testbm 0.1.11 → 0.1.16

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: 7263fa915363c5ea53a3a42ed7e781515a6420bd0203804e6fb7b1db91c9ded3
4
- data.tar.gz: 3aa0718ac6b8684e27e6ba179f4956330a1c887332b0769ef5424ca3481f18a7
3
+ metadata.gz: db9746f941149335d720d7d106e38a3bbcf534f86d5dbd8683352f07f90c8122
4
+ data.tar.gz: 1d0ad2a7a1209b82c38fd2e405f4f0dcb589f96367f214ee23f74eab823588d0
5
5
  SHA512:
6
- metadata.gz: 3112a212023aaeb452f33795243cc57fa62b448818e4b9ffac995281f8bec12ee7edceb6a679f0405965254f1d04b5480b34b723af9b29e5da6611fb8c99b955
7
- data.tar.gz: da198eda72c72f3c0e22d536167ce8cb4a2ee044e507f3c6df4e9e66f25c1e47ef7580665ea618d48516c14e7b52ef8b2f620bf8c4ff20013150bf012e3a335a
6
+ metadata.gz: c1ff7d907e1b2bed479d5e309111446d507d3b44e04e700f16f84a0167fdff4029d4d85089f826267e22665d639eb37f3fb4df0ce701d25ce89f76d392423293
7
+ data.tar.gz: 299d573260bfdaa081250a44ecd4c54b00aed962bd2f0380ea7e19c5c74c42e010c118355a1d19416af2a306b7568c099f69e1430aad93f2476e09669c693a49
@@ -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_error_in_lane(message_text)
11
+ else
12
+ self.slack_func_notify(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 self.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 self.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.11"
3
+ VERSION = "0.1.16"
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.11
4
+ version: 0.1.16
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