Book Image

Jenkins Essentials - Second Edition

By : Mitesh Soni
Book Image

Jenkins Essentials - Second Edition

By: Mitesh Soni

Overview of this book

<p>In agile development practices, developers need to integrate their work frequently to fix bugs or to create a new feature or functionality. Jenkins is used specifically for Continuous Integration, helping to enforce the principles of agile development. This book focuses on the latest and stable release of Jenkins (2.5 and later), featuring the latest features, such as Pipeline as Code, the new setup experience, and the improved UI. With the all-new Pipeline as Code feature, you will be able to build simple or advanced pipelines easily and rapidly, hence improving your teams' productivity.</p> <p>This book begins by tackling the installation of the necessary software dependencies and libraries you'll need to perform Continuous Integration for a Java application. From there, you'll integrate code repositories, applications, and build tools for the implementation of Continuous Integration.</p> <p>Finally, you will also learn how to automate your deployment on cloud platforms such as AWS and Microsoft Azure, along with a few advanced testing techniques.</p>
Table of Contents (17 chapters)
Title Page
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Dedication
Preface

Email notifications on build status


What if we want to send a notification of the build status from Jenkins? We can configure mail notifications in such scenarios.

If a Gmail account is configured with two-factor authentication, then the following process can help to setup notification systems:

  1. Go to Less secure apps in the Google account.
  2. Click on Learn More in the second paragraph where two-factor authentication is mentioned:
  1. Click on the App Password page:
  1. Provide a name and click on Generate:
  1. Copy the password:
  1. Go to Manage Jenkins and click on Configure system.
  2. Go to the Email notification section.
  1. Provide all required details and in the password field, copy the recently generated password for the Jenkins app.
  2. Click on Test configuration:
  1. Go to the PetClinic-Code job and select E-mailnotification from the Post build action:
  1. Execute the Jenkins job and if it fails, go to the console output and verify the output:
  1. Go to your inbox and verify the mail sent by Jenkins:

Done!