Build Orchestration Tool - Jenkins
Jenkins is a open source build orchestration tool.
Used to automate application builds and deployments
Other similar tools
gitlab-ci
bamboo
Azure Pipelines
AWS Code Pipeline
Jenkins Architecture
Jenkins is based on Master-Slave architecture.
Jenkins_Master Node(VM)
Install jdk,jenkins,git.
Used to Create the CI/CD Pipeline Projects and schedule to run in slave nodes.
Jenkins_Slave Node(VM)
To Execute the Application Build.
Perform Application Build - Compile, Unit Test, Create Artifacts
Build is a process of Compiling the Source Code and Creating Artifacts(Binaries/Executables - .exec/.dll/.jar/.war)
Scenario 1 : When projects are created using Java.
Jenkins_Master Node(VM)
- Install jdk,jenkins,git. Install Build Tools like maven
No need of slave node
Scenario 2 : When projects are created using multiple programming languages like Java, Dotnet, python etc
Jenkins_Master Node(VM)
- Create the CI/CD Pipeline Projects and schedule to run in slave nodes.
Jenkins_Slave Nodes(VM)
Jenkins_Slave_Node1(VM) - Java Application Build maven
Jenkins_Slave_Node2(VM) - Python Application Build
Jenkins_Slave_Node3(VM) - .Net Application Build
CI/CD Workflow
SCM_Checkout
Application Build
Unit Testing
Create Artifacts
Promote the Application to Test Environments
Notify
Deploy to Prod
Working with Jenkins
Developers Perspective :
Developers are just the consumer of Jenkins project
Developers can execute/cancel/read the Jenkins job output
DevOps Perspective :
- DevOps team are the administrator of the Jenkins.
Roles & Responsibilies of DevOps Team :
Jenkins Administration
Installation of Jenkins
Plugins Management
Global System Configurations
Tools Management
User Management
Security Management
Credential Management
Master/Slave Node Configurations
Creation CICD Pipeline Projects
Onboard Applications to use Jenkins CICD Projects
Periodic Upgrade of Jenkins and its plugins
Periodic Backup
Troubleshooting the Issues!
Installation of Jenkins
Install & Configure Jenkins Server :
Refer to that tools/Service's Official Documentation. https://www.jenkins.io/doc/book/installing/linux/
Launch AWS EC2 Instance AMI - Ubuntu 22.04v
t2.micro - Instance Type
#Allow All Traffic for Demo!
Update the Inbound Rule - Port 8080
Install the pre-requisites :
Install Jdk:
sudo -i
sudo apt update -y
sudo apt install git -y # To install git if required
sudo apt install openjdk-17-jre -y # previous version java -version
Install the Actual tool :
Install Jenkins:
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]" https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins -y
Perform Post_Installation Activities :::
jenkins --version
systemctl status jenkins
systemctl stop jenkins
systemctl start jenkins
systemctl restart jenkins
systemctl enable jenkins
- /var/lib/jenkins - Default Installation Dir of Jenkin on Linux Box
Open web browser :
- http://<Public_IP_Address>:8080/
cat /var/lib/jenkins/secrets/initialAdminPassword - to get password