100% found this document useful (1 vote)
216 views

Jenkins Automation

This document outlines the roadmap for two phases of a Jenkins automation course. Phase 1 covers introductory topics like Jenkins features and architecture, software development lifecycles, getting started with Jenkins, pipelines, Artifactory, GitHub, continuous integration and delivery with Jenkins using Maven. Phase 2 covers more advanced Jenkins concepts like job DSL, Jenkins with Docker, building applications with Jenkins integrations, and other concepts with a question and answer session. An introduction is also provided on what Jenkins is, its history starting as Hudson, features, and how it supports various version control tools and projects.

Uploaded by

satynarayana k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
216 views

Jenkins Automation

This document outlines the roadmap for two phases of a Jenkins automation course. Phase 1 covers introductory topics like Jenkins features and architecture, software development lifecycles, getting started with Jenkins, pipelines, Artifactory, GitHub, continuous integration and delivery with Jenkins using Maven. Phase 2 covers more advanced Jenkins concepts like job DSL, Jenkins with Docker, building applications with Jenkins integrations, and other concepts with a question and answer session. An introduction is also provided on what Jenkins is, its history starting as Hudson, features, and how it supports various version control tools and projects.

Uploaded by

satynarayana k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 30

Jenkins Automation

LogicOps Lab
Roadmap - Phase #1
Course Overview

 Introduction to Jenkins, features, architecture, et cetera


 Software development life cycle and DevOps culture
 Jenkins – Getting started
 Pipelines
 What is Artifactory?
 SCM – GitHub overview
 CI and CD with Jenkins
 A basic project using Maven
 Bonus – Tips and Tricks
Roadmap - Phase #2
Course Overview

 Jenkins - Advance concepts


 Prerequisites
 Building an app
 IaaC and automation
 Jenkins job DSL
 Jenkins with Docker
 Build, Test, Run everything
 Jenkins integrations with the application
 Other Jenkins concepts and Q/A
Introduction
 Jenkins is a free and open-source automation server. It
helps automate the parts of software development
related to building, testing, and deploying, facilitating
continuous integration and continuous delivery.

 It is a server-based system that runs in servlet


containers such as Apache Tomcat. It supports version
control tools, including AccuRev, CVS, Subversion,
Git, Mercurial, Perforce, ClearCase and RTC, and can
execute Apache Ant, Apache Maven and sbt based
projects as well as arbitrary shell scripts and Windows
batch commands.
History

 Originally – Hudson (2004)


 Creator - Kohsuke Kawaguchi (Written in Java)
 During November 2010, after the acquisition of Sun Microsystems by Oracle, an
issue arose in the Hudson community with respect to the infrastructure used
 Initial release – 2nd Feb, 2011
 In 2011, creator Kohsuke Kawaguchi received an O'Reilly Open Source Award
for his work on the Hudson/Jenkins project.
 On April 20, 2016 version 2 was released with the Pipeline plugin enabled by
default.The plugin allows for writing build instructions using a domain specific
language based on Apache Groovy.
 Jenkins replaced Hudson since February 8, 2017 in Eclipse.
Features
Software Development Life Cycle (SDLC)
Feasibility Studies

 Economic: Can we complete the project within the budget or not?


 Legal: Can we handle this project as cyber law and other regulatory
framework/compliances.
 Operation feasibility: Can we create operations which is expected by the
client?
 Technical: Need to check whether the current computer system can
support the software
 Schedule: Decide that the project can be completed within the given
schedule or not.
DevOps Culture
DevOps culture is all about a shared understanding between developers and operations, and sharing responsibility
for the software they build. That means increasing transparency, communication, and collaboration across
development, IT/operations, and "the business".
Jenkins – Getting Started

 Prerequisites (Java installation)


 Jenkins Download
 Jenkins Installation
 Other configurations
 Accessing the application over the browser
Git and GitHub

 What is Git?
 Download and install
 What is GitHub?
 Account creation on GitHub
 Basic commands to learn
 Why do we need GitHub in this course?
Git
 Git is the most widely used modern version control
system in the world
 Git was originally developed by Linus Torvalds
 Git is an example of a DVCS (Distributed Version
Control System)
 In addition to being distributed, Git has been designed
with performance, security and flexibility in mind.
GitHub

 GitHub, Inc. is a provider of Internet hosting for software


development and version control using Git.
 It offers the distributed version control and source code
management (SCM) functionality of Git, plus its own
features.
 It provides access control and several collaboration
features such as bug tracking, feature requests, task
management, continuous integration and wikis for every
project.
 Headquartered in California, it has been a subsidiary of
Microsoft since 2018.
Pipelines

 Pipeline is a suite of plugins which


support implementing and integrating
continuous integration/delivery into
Jenkins

 Pipeline provides an extensive set of


tools for modeling basic to complex
delivery and release pipelines.
Pipelines : Scripted

 The scripted pipeline is a traditional way of writing the Jenkins pipeline as code. Ideally, Scripted
pipeline is written in Jenkins file on web UI of Jenkins.

 Unlike Declarative pipeline, the scripted pipeline strictly uses groovy based syntax. Since this, the
scripted pipeline provides huge control over the script and can manipulate the flow of script extensively.

 This helps developers to develop advance and complex pipeline as code.


Syntax : Scripted Pipeline
node ('node-1') {
stage(‘CheckOut') {
git “https://github.com/your_repo_name.git''
}
stage('Compile') {
sh “ Your commands here ”
}
}
Pipelines : Declarative

 Declarative Pipeline is a relatively recent addition to Jenkins Pipeline which presents a more simplified
and opinionated syntax on top of the Pipeline sub-systems.

 Declarative Pipeline encourages a declarative programming model, whereas Scripted Pipelines follow a
more imperative programming model.

 Declarative type imposes limitations to the user with a more strict and pre-defined structure, which
would be ideal for simpler continuous delivery pipelines.

 Scripted type has very few limitations that to with respect to structure and syntax that tend to be defined
by Groovy, thus making it ideal for users with more complex requirements.
Syntax : Declarative Pipeline
pipeline {
agent any
stages {
stage('First') {
steps {
echo "This is 1st stage"
}
}
stage('Second') {
steps {
echo "This is 2nd stage"
}
}
}
}
JFrog Artifactory
 Why an artifactory?

Artifact - An artifact is any software asset that is connected to or part of a software project.

Management - These artifacts need to be stored and shared with all the developers on that project.

Quality, Consistency, and Accountability - All the artifacts need to be consistently managed, versioned,
and deployed across development teams and sometimes across multiple sites, to ensure quality, reliability
and auditability.
JFrog Integration with Jenkins

 We need a JFrog plugin to do JFrog integration with Jenkins.

 This integration allows you to add extra steps in your Jenkinsfile.

 Once build is completed the artefact that you created will be sent to JFrog
a) Can be configured to only do this (usage) for the branch of your choice.
b) Branch can change depending on your workflow.
SonarQube & Integration with Jenkins
(Part 1/2)

 What is SonarQube?

 Why SonarQube?

 What are the benefits of SonarQube?

 Download and Installation.

 Logging in and basic walkthrough.


 What is SonarQube?

 Why SonarQube?

 What are the benefits of SonarQube?

 Sustainability
 Increase productivity
 Quality code
 Detect Errors
 Increase consistency
 Business scaling
 Enhance developer skills
SonarQube & Integration with Jenkins
(Part 2/2)

 Plugin installation.

 Plugin configuration.

 Integration with Jenkins pipelines.

 Execution with a project and obtaining results.


E-Mail Notification & View Configuration

 Upstream and Downstream jobs.


 E-mail plugin for Jenkins.
 Mail configuration for jobs.
 How to send a success/failure mail for any build.
 View creation for specific jobs.
 Potential pitfalls.
Slack Integration with Jenkins

 What is Slack?
 Why Slack?
 Free or Paid?
Jenkins – Master Slave :
Concept & Architecture

 What is Master Slave architecture?


 Why do we need it?
 How to configure it?
 Demo.
Jenkins Master-Slave : Preface

 52.191.26.213 - Jenkins Master Node (Windows) – A Virtual Machine running on Cloud.


 192.168.1.6 - Jenkins Slave/Client/Agent (Windows) – My personal laptop.
 Configuration check –
 Inbound Jenkins port (8090 here) MUST be open on your Security Group (AWS).
 Inbound Jenkins port (8090 here) MUST be open on your Network Interface (Azure).
 Inbound Rule created in a Firewall MUST have Jenkins port (8090 here) open.
 Same Java version on both MASTER and SLAVE.
 Good internet connectivity.
BackUp in Jenkins

 Why do we need backup?


 Types of BackUp
1) Full
2) Differential
3) Incremental
Multi-Branch Pipelines in Jenkins
 What is Multi-Branch Pipeline?
 Why do we need it?
 Creation & Configuration.
 Demo.
Prerequisites
 Basic Linux commands
 Basic of any language (we can take java) - Suggestion
 What is Maven?
 What is GIT?
 What is GitHub?
 What is Bit Bucket?
 What is CI&CD?
 What is Jenkins?
 What is VM, Containers, Hypervisors?
 What is Docker?
 What is JFrog?
 What is SonarQube?

You might also like