fastlane-plugin-mattermost 1.0 → 1.2
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: ecb9643b7faf22c32af2a67a052e83cc1ed7510061b02e3555a55714eb3586de
|
4
|
+
data.tar.gz: dc1057f5c223945ece0a62e676a96a3b8b2b36ac69a1e83e81119d993a8c4dc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c99076cc297933afc08203d1b6eecf1db8dbde497751d972b22dcfeeb8f546cea9be2a4a8f2a57b45393cc0a93c8a80eda22b8ec6abcab8a71d9e5bc4e6e4896
|
7
|
+
data.tar.gz: d4b3eae8ec4b02b1967c026e7bc28f08b273d12091d063850454db9671237a07eb39b86d1b54fc3ff1ab33191e5b0fb8b2a95210156d921f4aea8444a7f129ce
|
data/README.md
CHANGED
@@ -25,7 +25,9 @@ lane :build_android do
|
|
25
25
|
# Push messages to Mattermost
|
26
26
|
mattermost(
|
27
27
|
url: "https://example.mattermost.com/hooks/xxx-generatedkey-xxx",
|
28
|
-
|
28
|
+
text: "Hello, this is some text\nThis is more text. :tada:",
|
29
|
+
username: "Fastlane Mattermost", # optional
|
30
|
+
icon_url: "https://www.mattermost.org/wp-content/uploads/2016/04/icon.png" # optional
|
29
31
|
)
|
30
32
|
```
|
31
33
|
|
@@ -11,12 +11,16 @@ module Fastlane
|
|
11
11
|
require 'json'
|
12
12
|
|
13
13
|
begin
|
14
|
-
uri = URI.parse(params[:url]
|
14
|
+
uri = URI.parse(params[:url])
|
15
15
|
header = {
|
16
16
|
'Content-Type': 'application/json'
|
17
17
|
}
|
18
18
|
body = {
|
19
|
-
'
|
19
|
+
'payload': {
|
20
|
+
'text': params[:text],
|
21
|
+
'username': ((params[:username].nil? || params[:username].strip.empty?) ? "Fastlane Mattermost" : params[:username]),
|
22
|
+
'icon_url': ((params[:icon_url].nil? || params[:icon_url].strip.empty?) ? "https://www.mattermost.org/wp-content/uploads/2016/04/icon.png" : params[:icon_url])
|
23
|
+
}
|
20
24
|
}
|
21
25
|
http = Net::HTTP.new(uri.host, uri.port)
|
22
26
|
http.use_ssl = (uri.scheme == 'https')
|
@@ -53,9 +57,17 @@ module Fastlane
|
|
53
57
|
env_name: "MATTERMOST_WEBHOOKS_URL",
|
54
58
|
sensitive: true,
|
55
59
|
description: "Mattermost Incoming Webhooks URL"),
|
56
|
-
FastlaneCore::ConfigItem.new(key: :
|
60
|
+
FastlaneCore::ConfigItem.new(key: :text,
|
57
61
|
env_name: "MATTERMOST_WEBHOOKS_PARAMS",
|
58
|
-
description: "Mattermost Incoming Webhooks Params")
|
62
|
+
description: "Mattermost Incoming Webhooks Params"),
|
63
|
+
FastlaneCore::ConfigItem.new(key: :username,
|
64
|
+
env_name: "MATTERMOST_WEBHOOKS_USERNAME",
|
65
|
+
optional: true,
|
66
|
+
description: "Mattermost Incoming Webhooks Username"),
|
67
|
+
FastlaneCore::ConfigItem.new(key: :icon_url,
|
68
|
+
env_name: "MATTERMOST_WEBHOOKS_ICON_URL",
|
69
|
+
optional: true,
|
70
|
+
description: "Mattermost Incoming Webhooks Icon URL")
|
59
71
|
]
|
60
72
|
end
|
61
73
|
|
@@ -71,7 +83,9 @@ module Fastlane
|
|
71
83
|
[
|
72
84
|
'mattermost(
|
73
85
|
url: "https://example.mattermost.com/hooks/xxx-generatedkey-xxx",
|
74
|
-
|
86
|
+
text: "Hello, this is some text\nThis is more text. :tada:",
|
87
|
+
username: "Fastlane Mattermost",
|
88
|
+
icon_url: "https://www.mattermost.org/wp-content/uploads/2016/04/icon.png"
|
75
89
|
)'
|
76
90
|
]
|
77
91
|
end
|