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

First job in Jenkins


Let's create a job in Jenkins that provides details about IP addresses and other configuration details. Basically, we will execute the ipconfig command. If you are using Linux OS, you can execute ifconfig. The following are the steps to create your first job in Jenkins:

  1. On the Jenkins dashboard, click on New Item.
  2. Enter the item's name.
  3. Select Freestyle project.
  4. Click Ok:
  1. Give a Project name:
  1. Select None in Source Code Management.
  1. In the Build Triggers section, select Build periodicallyand give cron syntax in Schedule. It will always run at 8:52 AM in the morning:
  1. In Build, click on Execute Windows batch command. To execute on CentOS or other flavours of Linux, select Execute Shell, and the command will be ifconfig:
  1. In the textbox, write the ipconfig command to get the IP address of the system.
  2. Click on Save:
  1. Click on Buildnow:
  1. Observe the Build History and click on the blue ball to go to Console Output. Bingo! We have created our first job in Jenkins:
  1. To add a parameter in the Jenkins...