A CircleCI plugin for Mattermost. Supports CircleCI SaaS.
- Audience
- License
- About the CircleCI Plugin
- Before You Start
- Configuration
- Using the Plugin
- Onboarding Your Users
- Development
This guide is intended for Mattermost System Admins setting up the CircleCI plugin and Mattermost users who want information about the plugin functionality. For more information about contributing to this plugin, visit the Development section.
This repository is under the MIT License.
The Mattermost CircleCI plugin uses a webhook to connect your CircleCI account to Mattermost to listen for incoming CircleCI events. Event notifications are published in the channels where they are subscribed.
After your System Admin has configured the CircleCI plugin, run /circleci connect
in a Mattermost channel to connect your Mattermost and CircleCI accounts.
Once connected, you'll have access to the following features:
- Event Subscriptions - Ability to subscribe to build notifications for specified repositories.
- Build - Ability to trigger build in CircleCI for a project. The build can be triggered for either a branch or a tag.
- Recent Builds - View recent builds for a repository's workflow. For example, view recent builds for
release
workflow. - Pipeline by Number - Get details of a pipeline by it's number. Each pipeline execution in CircleCI has a user-readable number which can be used for identifying a pipeline execution.
- Environment - Get a list of masked context variables available to in pipeline.
- Project Insights - Get project insights on demand such as success rate, throughput, mean duration etc.
- Workflow Insights - Get insights of a workflow's runs. This includs details such as execution time, credits used and status.
This guide assumes:
- You have a CircleCI account.
- You're a Mattermost System Admin.
- You're running Mattermost v5.20 or higher.
- Go to the plugin system console settings to generate the Webhook Secret and Encryption Key and enable the plugin. Note the value of the
Webhook Secret
. - Make sure you are using CircleCI config version v2.1 or above.
- Use the
status
command from the Mattermost Orb, which is added in the.circleci/config.yml
of this repo as the last step of any CircleCI Job you created for your workflow to enable notifications to Mattermost. - Go to your project settings on CircleCI and add an Environment Variable with the name
WEBHOOK_URL
with the value:http://<mattermost_url>/plugins/com.mattermost.circleci/api/v1/webhook?secret=<webhook_secret>
- Replace
<mattermost_url>
with your site URL, for example:community.mattermost.com
- Replace
<webhook_secret>
with the secret generated in the first step
- Replace
- Go to CircleCI.
- Open your profile settings by clicking on your avatar on the bottom left.
- Select the option
Personal Access Token
. - Click on
Create New Token
. - Give it an identifiable name such as
Mattermost CircleCI Plugin
. - Click on
Add API Token
. - Make sure you copy the token as once you close the dialog, you cannot see the generated token again.
- Go to the channel in which you want to subscribe to notifications for your project.
- Use the
/circleci subscribe
command to subscribe this channel to notifications.- Usage:
/circleci subscribe <VCS-Type> <Owner-Name> <Repo-Name>
- Example:
/circleci subscribe github chetanyakan mattermost-plugin-circleci
- Usage:
Once you've generated the personal access token, run the /circlec connect <your auth token>
slash command from any channel within Mattermost to connect your Mattermost account with CircleCI.
When you’ve tested the plugin and confirmed it’s working, notify your team so they can connect their CircleCI account to Mattermost and get started. Copy and paste the text below, edit it to suit your requirements, and send it out.
Hi team,
We've set up the Mattermost CircleCI plugin, so you can get notifications from CircleCI in Mattermost. To get started, run the
/circleci connect
slash command from any channel within Mattermost to connect your Mattermost account with CircleCI. Then, take a look at the available features in the plugin for more details.
This plugin contains a server portion. Read our documentation about the Developer Workflow and Developer Setup for more information about developing and extending plugins.
Do not post a GitHub ticket for security vulnerability. Please report any security vulnerability to @harshilsharma63
or @chetanyakan
on Community Mattermost.