What is jenkins and CI/CD?
Lab Setup & Installation
Jenkins Dashboard Overview
Some Basic Jenkins Job
Scheduling The Job
Working with GIT Repo
Email Notification
Topics Job for action on Remote server
Jenkins + Ansible Playbook
Project - Website Update on Remote Server
User Management (Role Based)
Envirnment Variables
Jenkins + MAVEN
CI/CD Project (Jenkins PIPELINE)
Bonus Tips
What is Jenkins?
Jenkins is an open-source
automation server
Automate various parts of
software development.
Building Testing Deploy
What is CI/CD?
CI/CD is a method of frequently delivering apps
to customers by introducing automation into
the stages of app development.
Lab Setup
Installation
sudo dnf upgrade
sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-
stable/jenkins.io-2023.key
sudo yum install jenkins
sudo systemctl start/stop jenkins
To start the Jenkins from browser: IP:8080
To access it from browser, we need to enable it on firewall
--------------------------------------------------------------------------
sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp
sudo firewall-cmd --reload
Overview Of
DASHBOARD
Git hub link - https://github.com/paulphilip/pythoncode
GMAIL SMTP
Git hub link - https://github.com/paulphilip/pythoncode
Task like
Transfer file
Execute Commands
SERVER A
SERVER B
ServerA ServerB ServerC ServerD
Module
Inventory
Apache Webserver
SERVER A
SERVER B
Summary of Jenkins + Ansible Section
Quick overview of Ansible
Installing Ansible plugin
Jenkins job with ‘Invoke Ansible Playbook’
Perform task on Local vs Remote host
Ansible job execute as ‘jenkins’ user
Execute task which required SUDO access
Basic project of Updating the Webpage of remote
server and publish it.
User Management
Plugin: Role-based Authorization Strategy
Create a new user
Manage Jenkins:
Security -> Autorization -> Role-based
Manage and Assign Roles
Add a new read-only role and assign the
permission
Assign Roles -> Add new user (nick) and assign
read-only role
Environment Variables
We can use pre-defined variables by jenkins
like
BUILD_NUMBER, WORKSPACE etc
https://wiki.jenkins.io/display/JENKINS/Building+a+software+project#Buildingasoftwar
eproject-belowJenkinsSetEnvironmentVariables
What is maven?
Maven is a build automation tool used
primarily for Java projects.
Working with Git and Maven
Build jar using Maven
Testing
Deploy jar locally
Graphical representation of results
Send Email notification
Jenkins Pipeline
https://www.jenkins.io/doc/book/pipeline/