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

Quality Gate plugin


The Quality Gate plugin is useful if we want to fail the Jenkins job based on the result of Quality Gate:

  1. Install the Sonar Quality Gates Plugin in Jenkins:
  1. As of now, Quality Gate is passed for our sample application:
  1. Go to the Quality Gates tab and add a condition where if issues are greater than 10, then it should give an error.
  1. In the same PetClinic-Code build job, as a Quality Gates SonarQube plugin action from Add post-build action. It asks for the Quality Gates configuration in the Jenkins configuration:
  1. Go to Manage Jenkins, click on Configure system, and configure Sonar instance for Quality Gates:
  1. We already have sonar-project.properties in the application. Note the project key:
  1. In the Jenkins job, enter the same Project Key and click Save:
  1. Click on Build now to execute a Jenkins build job.
  1. The Jenkins job has failed. Go through the console output and the reason will be Quality Gate failure:
  1. Go to the SonarQube dashboard and verify the reason for Failure and Quality Profile...