fastlane-plugin-testbm 0.1.9 → 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: 28701adcc3be5cf4d3346f9d339599fc47eb7b525658efb9d5a3cd25056ced7b
4
- data.tar.gz: 87269fc3ff27be4156a9712ebe82f0b138308645c838bae3d14023a8c489a93c
3
+ metadata.gz: bcd61940e70a70bbe60de392871389904753e8659b45abba644889172ee99dde
4
+ data.tar.gz: d1278252b7289fd5980db51d6fd6392ecaaaf21990290bb290c6ca7180a367e3
5
5
  SHA512:
6
- metadata.gz: 38e384494416c52b26d13498b45b5cc8999240d51c97447a97b7ecb3ce6c304be55e5219c9102303ad3fd8201b5bb3f771e6af2abe8323ccde960078856244ae
7
- data.tar.gz: e2977228122429e186caf7b726be6e3aad53cf5a87b670e24d68e7edfc9c6f8b4535abd61d4ce78e7c17740c117e0a9985be660e4a2ee14fa6e56c2c067c76a9
6
+ metadata.gz: 8469fb0657b04596fa56d3efcf0fbe5d5928cfa89d679b81327b0fb23c5e945962ee332ba1a7d457b913a17999381312d71d117fd51cfd849be9bc4c5592bf01
7
+ data.tar.gz: 20482981e3d50681ef0dcf87f57301e2358326ad5bbe1715b3a7131615ee673b3f60a7fbe61be0a3a862fbe71411ae31a2c2c1df0d10db9be8ee9fc20fb56cf5
@@ -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.9"
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.9
4
+ version: 0.1.14
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 helper.")
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: :chat_message,
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