diff --git a/06-notifications.md b/06-notifications.md index e69de29..db0ce98 100644 --- a/06-notifications.md +++ b/06-notifications.md @@ -0,0 +1,48 @@ +# 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`. +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](./images/06-notifications/change-gradle-tasks.png) + +Find the plugin and install it. + +![Google Chat Plugin](./images/06-notifications/google-chat-plugin.png) + +Add a new chat room. + +![Chat Room](./images/06-notifications/create-room.png) + +For the chat room, click the little cog icon and create a new webhook. + +![Add Webhook](./images/06-notifications/add-webhook.png) + +Enter an appropriate name for the webhook. + +![Webhook Naming](./images/06-notifications/webhook-naming.png) + +Copy the generate webhook URL to the clipboard. + +![Webhook URL](./images/06-notifications/webhook-url.png) + +In the Jenkins job, create a new Google Chat notification. Add the webhook URL and provide a name. + +![Notification Configuration](./images/06-notifications/notification-config.png) + +Run a build. It should fail and send a new message to the chat room. + +![Chat Room Message](./images/06-notifications/chat-room-message.png) + +

+
\ No newline at end of file diff --git a/images/06-notifications/add-webhook.png b/images/06-notifications/add-webhook.png new file mode 100644 index 0000000..8247187 Binary files /dev/null and b/images/06-notifications/add-webhook.png differ diff --git a/images/06-notifications/change-gradle-tasks.png b/images/06-notifications/change-gradle-tasks.png new file mode 100644 index 0000000..0a7d976 Binary files /dev/null and b/images/06-notifications/change-gradle-tasks.png differ diff --git a/images/06-notifications/chat-room-message.png b/images/06-notifications/chat-room-message.png new file mode 100644 index 0000000..6de3cf4 Binary files /dev/null and b/images/06-notifications/chat-room-message.png differ diff --git a/images/06-notifications/create-room.png b/images/06-notifications/create-room.png new file mode 100644 index 0000000..1b7010b Binary files /dev/null and b/images/06-notifications/create-room.png differ diff --git a/images/06-notifications/google-chat-plugin.png b/images/06-notifications/google-chat-plugin.png new file mode 100644 index 0000000..812d0a7 Binary files /dev/null and b/images/06-notifications/google-chat-plugin.png differ diff --git a/images/06-notifications/notification-config.png b/images/06-notifications/notification-config.png new file mode 100644 index 0000000..9e68011 Binary files /dev/null and b/images/06-notifications/notification-config.png differ diff --git a/images/06-notifications/webhook-naming.png b/images/06-notifications/webhook-naming.png new file mode 100644 index 0000000..615cfc3 Binary files /dev/null and b/images/06-notifications/webhook-naming.png differ diff --git a/images/06-notifications/webhook-url.png b/images/06-notifications/webhook-url.png new file mode 100644 index 0000000..c3616b9 Binary files /dev/null and b/images/06-notifications/webhook-url.png differ