diff --git a/exercises/06-notifications/instructions.md b/exercises/06-notifications/instructions.md new file mode 100644 index 0000000..11ca9c3 --- /dev/null +++ b/exercises/06-notifications/instructions.md @@ -0,0 +1,12 @@ +# Exercise 6 + +This exercise will demonstrate the use of a Google Chat room as way to send a notification upon a failed build. Given the locked down nature of Google Chat, this exercise will only be demonstrated by the instructor. + +## 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 Notification plugin](https://plugins.jenkins.io/google-chat-notification). +3. Create a new chat room in Google Chat named `jenkins-test` at [https://chat.google.com/](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. \ No newline at end of file diff --git a/exercises/06-notifications/solution/images/add-webhook.png b/exercises/06-notifications/solution/images/add-webhook.png new file mode 100644 index 0000000..8247187 Binary files /dev/null and b/exercises/06-notifications/solution/images/add-webhook.png differ diff --git a/exercises/06-notifications/solution/images/change-gradle-tasks.png b/exercises/06-notifications/solution/images/change-gradle-tasks.png new file mode 100644 index 0000000..0a7d976 Binary files /dev/null and b/exercises/06-notifications/solution/images/change-gradle-tasks.png differ diff --git a/exercises/06-notifications/solution/images/chat-room-message.png b/exercises/06-notifications/solution/images/chat-room-message.png new file mode 100644 index 0000000..6de3cf4 Binary files /dev/null and b/exercises/06-notifications/solution/images/chat-room-message.png differ diff --git a/exercises/06-notifications/solution/images/create-room.png b/exercises/06-notifications/solution/images/create-room.png new file mode 100644 index 0000000..1b7010b Binary files /dev/null and b/exercises/06-notifications/solution/images/create-room.png differ diff --git a/exercises/06-notifications/solution/images/google-chat-plugin.png b/exercises/06-notifications/solution/images/google-chat-plugin.png new file mode 100644 index 0000000..812d0a7 Binary files /dev/null and b/exercises/06-notifications/solution/images/google-chat-plugin.png differ diff --git a/exercises/06-notifications/solution/images/notification-config.png b/exercises/06-notifications/solution/images/notification-config.png new file mode 100644 index 0000000..9e68011 Binary files /dev/null and b/exercises/06-notifications/solution/images/notification-config.png differ diff --git a/exercises/06-notifications/solution/images/webhook-naming.png b/exercises/06-notifications/solution/images/webhook-naming.png new file mode 100644 index 0000000..615cfc3 Binary files /dev/null and b/exercises/06-notifications/solution/images/webhook-naming.png differ diff --git a/exercises/06-notifications/solution/images/webhook-url.png b/exercises/06-notifications/solution/images/webhook-url.png new file mode 100644 index 0000000..c3616b9 Binary files /dev/null and b/exercises/06-notifications/solution/images/webhook-url.png differ diff --git a/exercises/06-notifications/solution/solution.md b/exercises/06-notifications/solution/solution.md new file mode 100644 index 0000000..358ff4c --- /dev/null +++ b/exercises/06-notifications/solution/solution.md @@ -0,0 +1,33 @@ +# Solution + +Change the list of Gradle tasks first. + +![Gradle Tasks](./images/change-gradle-tasks.png) + +Find the plugin and install it. + +![Google Chat Plugin](./images/google-chat-plugin.png) + +Add a new chat room. + +![Chat Room](./images/create-room.png) + +For the chat room, click the little cog icon and create a new webhook. + +![Add Webhook](./images/add-webhook.png) + +Enter an appropriate name for the webhook. + +![Webhook Naming](./images/webhook-naming.png) + +Copy the generate webhook URL to the clipboard. + +![Webhook URL](./images/webhook-url.png) + +In the Jenkins job, create a new Google Chat notification. Add the webhook URL and provide a name. + +![Notification Configuration](./images/notification-config.png) + +Run a build. It should fail and send a new message to the chat room. + +![Chat Room Message](./images/chat-room-message.png) \ No newline at end of file