Jenkins Administrative Activies
-
Install the following Plugins
- Dashboard View
- Monitoring
- Audit Trail
- Disk-Usage Plugin
- Backup plugin
-
Backing up and restoring Jenkins:
- After Installing plugins. Navigate to Manage Jenkins and search for backup plugins

- Once the backups are taken then we get the restore options.
- Also explore thin backup plugin
- After Installing plugins. Navigate to Manage Jenkins and search for backup plugins
-
Managing disk usage
- Navigate to Manage Jenkins and Navigate to Disk Usage

- Now Navigate to Manage Jenkins => Configure System

- Now Navigate to Jenkins Home & Select Disk Usage

- Navigate to any project where you have build the jenkins job

- Navigate to Manage Jenkins and Navigate to Disk Usage
-
Preparing Jenkins for Shutdown
- Navigate to Manage Jenkins

- Navigate to Manage Jenkins
-
Monitoring of Jenkins Master

-
Configuring email notifications:
- Refer here
- Mailtrap seems to be good for testing mails Refer Here
-
Jenkins needs to be used from cli by writing commands, For this we have two options
- Jenkins CLI

- Call Jenkins Rest API using curl command
- In the Jenkins footer we have a link to jenkins REST API
- Refer Here for jenkins remote api docs

- Jenkins CLI
-
User Management in Jenkins:
- Jenkins Provides the following options for configuring users (Authentication)
- Jenkins Database (Allow Signup)
- Jenkins & OpenLDAP Integration
- Jenkins & Active Directory Intergation

- Configuring Authorization using Matrix Based Security

- Let change authorization to Matrix Based security

- Jenkins Provides the following options for configuring users (Authentication)
Scenario: Learning Thoughts Jenkins Configuration
- Learning Thoughts has 3 Business Units
- HRMS:
- Hosted on Ubuntu Linux
- Developed in Java
- HMS
- Hosted on RedHat Enterprise Linux
- Has Java, Python & Node Js as this project is result of multiple acquistions
- LMS
- Hosted on Windows Server
- Developed in .net
- HRMS:
- As a DevOps Engineer of Learning Thoughts, Don is supposed to build, provide all environments and deploy all the applications to production when needed
- As of Now Learning Thoughts Wants to use the Jenkins for CI/CD pipelines.
- How can Don manage this?
- Manage Different Jenkins Masters
- Jenkins Master for HRMS
- Jenkins Master for HMS
- Jenkins Master for LMS
- But this is already sounding like a stupid approach.
- To Solve these kind of problems Jenkins supports Distributed Builds.
- Manage Different Jenkins Masters
- Distributed Build Terms
- Masters
- Node
- Agents
- Executors
- Labels

- Jenkins is collection of Nodes. Each Node represents a Physical or a virtual machine. Nodes are of two types
- Master
- Agent
- Master to Agent communication can happen via
- SSH: Configure Linux, Mac & Unix Nodes
- JNLP: Configure Windows Nodes.
- On Every Agent we would have a Remote Working Directory
Lets Create a Jenkins Distribute Build Environment for Learning Thoughts
-
Our setup would be
- Jenkins Master:
- Ubunutu 20 Machine (AWS)
- Executor: 1
- Labels: Master
- Software:
- Java
- Git
- Jenkins HRMS QA Node
- Ubunutu 18 Machine (AWS)
- Software Set:
- Git
- JAVA 8
- MAVEN 3.6.3
- Labels:
- HRMS
- QA
- Executors: 2
- Project: Gameoflife
- Jenkins Master:
-
Master Configuration:
- Install Jenkins
- Navigate to manage jenkins

-
Jenkins HRMS QA Node configuration
- Login into the machine and create a new user called as jenkins (In your org you might be using service accounts)
sudo -i adduser jenkins vi /etc/ssh/sshd_config # change PasswordAuthentication from No to yes service sshd restart # add sudo previleges with NOPASSWD if required- Install Java
- Install Maven
-
Now lets configure this node as agent to jenkins master
- Try logging in from jenkins user on master node to agent
- Navigate to Manage Jenkins => Manage Nodes and add a new node

-
Lets create a build job for lthrmsqa

-
Now configure any java project to build, show test results and archive the artifacts
-
Now build the project & observe on which node & executor the project got scheduled

