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: d8a460fb48fe25f966581966fdda9422621a6d57b5b6296d270d95df21a94151
4
- data.tar.gz: 16bedd08246b2d75cb876e5c273b0bc1069f356708dafbb78ccf152c26134c56
3
+ metadata.gz: ecb9643b7faf22c32af2a67a052e83cc1ed7510061b02e3555a55714eb3586de
4
+ data.tar.gz: dc1057f5c223945ece0a62e676a96a3b8b2b36ac69a1e83e81119d993a8c4dc7
5
5
  SHA512:
6
- metadata.gz: 1f9281dac83b70f2adc1c79ad95380a66a29ccb354321cae332225a307724a53bbf71619a488fc237c3415c771b935c218be6dfd39ac5fbf8caca8bd13b645da
7
- data.tar.gz: 48f14cb560adf6edc79e51c64f7b8bafca6a604b4ac68cf9c74233690e77112268881f565afd277d89cc193b0d4589fb6f15d3add8d878c84e49e732f06c7131
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
- params: "Hello, this is some text\nThis is more text. :tada:"
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] || MATTERMOST_WEBHOOKS_URL)
14
+ uri = URI.parse(params[:url])
15
15
  header = {
16
16
  'Content-Type': 'application/json'
17
17
  }
18
18
  body = {
19
- 'text': (params[:params] || MATTERMOST_WEBHOOKS_PARAMS)
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: :params,
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
- params: "Hello, this is some text\nThis is more text. :tada:"
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
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Mattermost
3
- VERSION = "1.0"
3
+ VERSION = "1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-mattermost
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: '1.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - cpfriend1721994