Use the Jenkins app in Chat to get notifications about your Jenkins builds.
Before you begin
- You need permission from your Google Workspace administrator to install apps.
- You need to add the app to Chat.
Learn how to find apps and add them to Chat.
Step 1: Install Chat plugin on Jenkins server
You must sign in as a Jenkins administrator to do this task.
- Download the Chat Notifier Plugin file.
- In Jenkins, go to Manage JenkinsManage Plugins.
- On the Advanced tab, under Upload Plugin, select the downloaded plug-in file from step 1 and click Upload.
People in your organization can now install and set up the Jenkins app.
Step 2: Set up the Jenkins app in Chat
Jenkins needs the token that the app generates to send build notifications to Chat. Each space that you add the app to gets a token. The app sends notifications to all spaces where it's a member.
- Open Chat.
- Open a direct message with the app or go to a space with the app.
- Copy the token displayed by the app.
- (Optional) To display the token again, choose an option:
- In a direct message, enter token.
- In a space, enter @Jenkins token.
- (Optional) To regenerate the token, click Regenerate Token.
Step 3: Set up notifications
Get notifications for a build
- Open Jenkins.
- Go to the build that you want to add Chat notifications for.
- Under Build, next to Add build step, click the Down arrow and choose what to get notifications for, such as the build result.
- Under Post-build Actions, next to Add post-build actions, click the Down arrow and select Notify Hangouts Chat.
- Choose one of the following options and paste the token that you copied from Chat.
- Chat—Choose a global configuration that you previously set up.
- Chat Token—Override the global configuration for a specific Chat space.
- Check the boxes for the items that you want to get notifications about in Chat.
- Click Save.
You get notifications in Chat about build events, such as start, failure, and success. From a notification, you can click:
- Open Build—Modify the build configuration in Jenkins.
- View Details—View information about the notification.
Get notifications for a pipeline
- Open Jenkins.
- Open the pipeline that you want to add Chat notifications for.
- In your pipeline script, enter:
hangoutsNotify message: "This message is from a pipeline!",token: "your_jenkins_token",threadByJob: false
Note: In the above text, replace your_jenkins_token with the token that you copied above. You can set threadByJob to true or false.
- Click Save.
Using the app in spaces
To use the app in spaces, you need to explicitly @mention the app in each message to the app (including in replies to messages from the app). The @mention confirms you're sending the message to the app and not to others in the space.
Google, Google Workspace, and related marks and logos are trademarks of Google LLC. All other company and product names are trademarks of the companies with which they are associated.