Files
cje-prep/06-notifications.md
Benjamin Muschko 3196abca24 Minor corrections
2019-08-09 17:25:52 -06:00

1.6 KiB

Key CI/CD/Jenkins Concepts and their Usage

Notifying the Team Upon a Broken Build

  1. Change the list of Gradle tasks to doesnotexist to emulate a failure. The build will fail as the task doesn't exist in the build script.
  2. Install the Google Chat plugin.
  3. Create a new chat room in Google Chat named jenkins-test at https://chat.google.com/.
  4. For the chat room configure the webhook.
  5. Configure the job to send a notification whenever the job fails. Use the webhook generated on Google Chat.
  6. Execute the build. The build should fail and send a notification to the chat room.
Show Solution

Change the list of Gradle tasks first.

Gradle Tasks

Find the plugin and install it.

Google Chat Plugin

Add a new chat room.

Chat Room

For the chat room, click the little cog icon and create a new webhook.

Add Webhook

Enter an appropriate name for the webhook.

Webhook Naming

Copy the generate webhook URL to the clipboard.

Webhook URL

In the Jenkins job, create a new Google Chat notification. Add the webhook URL and provide a name.

Notification Configuration

Run a build. It should fail and send a new message to the chat room.

Chat Room Message