雖然 drone plugins裡面沒有mattermost的plugin,但mattermost非常非常與slack可以相容,所以我們就找drone plugin for slack的來使用即可。
drone yaml 設定
kind: pipeline
name: ithome
steps:
- name: send mattermost notification
when:
branch: master
image: plugins/slack
settings:
webhook:
from_secret: my-webhook
channel: gitea
mattermost channel內顯示
drone yaml 設定
kind: pipeline
name: ithome
steps:
- name: send mattermost notification
when:
branch: master
image: plugins/slack
settings:
webhook:
from_secret: my-webhook
channel: gitea
username: ithome-use
mattermost channel內顯示
drone yaml 設定
kind: pipeline
name: ithome
steps:
- name: send mattermost notification
when:
branch: master
image: plugins/slack
settings:
webhook:
from_secret: my-webhook
channel: gitea
username: ithome-use
image_url: https://unsplash.it/256/256/?random
mattermost channel內顯示
drone yaml 設定
kind: pipeline
name: ithome
steps:
- name: send mattermost notification
when:
branch: master
image: plugins/slack
settings:
webhook:
from_secret: my-webhook
channel: gitea
username: drone
template: >
【溫馨提醒】分支: {{build.branch}},異動者: {{build.author}} 更版動作開始 {{build.link}} !!
mattermost channel內顯示
今日練習是不是很簡單呢?這方法可以用在當你在CI/CD有任何問題或執行成功時,可以透過這個plugin將訊息推送到你的mattermost channel很方便吧~