JENKINS Advanced ( CI-CD )

Cloudy Buddy
6 min readNov 22, 2023

--

1, Public / Private Key Knowledge

2, Master / Slave Configuration Between @ Ubuntu_Servers

3, Run Job @Master_Jenkins → Execute Job @Slave_Server_1

4, But in real-time we use Ansible for Master / Slave Configuration instead of using Jenkins CD.

5, Pipelines_Views

6, Plug-Ins used in my project → “ 10 “

( Role-based authorization strategy, Deploy to Container, Backup, Delivery pipeline, Build pipeline, Build Monitor, Prameterised trigger, Git, Maven, Sonnar_Qube )

7, Task → Parameterised Plugin

8, >><< Over_all_Jenkins_Class_Topics >><<

1, Public and Private key Knowledge →

Private Key:

In the Private key, the same key (secret key) is used for encryption and decryption. This key is symmetric because the only key is copied or shared by another party to decrypt the cipher text. It is faster than public-key cryptography.

Public Key:

In a Public key, two keys are used one key is used for encryption and another key is used for decryption. One key (public key) is used to encrypt the plain text to convert it into cipher text and another key (private key) is used by the receiver to decrypt the cipher text to read the message. Now, we see the difference between them:

2, Master-Slave Configuration — “No need to switch over root user”

  • STEP 2.1 →Create 2 (1 — Master_jenkins_server & 2 -Slave_server)
  • STEP 2.2 → Install Java, Jenkins @Master_jenkins_Server

Use this bootstrap to install Jenkins and Java on UBUNTU_LINUX

#! /bin/bash
sudo apt-get update
sudo apt install fontconfig openjdk-17-jre -y
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
systemctl start jenkins
  • STEP 2.3 → Install Java@Slave_Server_1
#! /bin/bash
sudo apt-get update
sudo apt install fontconfig openjdk-17-jre -y
  • STEP 2.4 → Create 2 files @Master_Jenkins for ( 2-way Communication )
# cp authorized_keys id_rsa.pub
# vi id_rsa ( Paste .pem key datils )
# chmod 400 *
# ssh localhost
# ssh ubuntu@Slave_machine_IP
  • STEP 2.5 → Create 2 files @Slave_Jenkins for ( 2-way Communication )
# cp authorized_keys id_rsa.pub
# vi id_rsa ( Paste .pem key datils )
# chmod 400 *
# ssh localhost
# ssh ubuntu@Slave_machine_IP
  • STEP 2.6 → Create 2 files @Slave_server
  • STEP 2.7 → Initilize Jenkins with Suggested Plugins
  • STEP 2.8 → Create New Node ( Give all details of Slave_Server_1 )
# By the click of a button how many jobs can run that we can mention here
  • Step 2.9 → Checked Master_Jenkins_server & Slave_Server_1 ( Synced )
  • STEP 2.9.1 → Also Confirm the @ Slave_Server_1 ( CLI )

3, Run Job @Master_Jenkins → Execute Job @Slave_Server_1

  • STEP 3.1 → Create a Job Name @ ( Test_Slave_1 )
  • STEP 3.2 → “ CHECKED “ Run Job @Master_Jenkins → Execute Job @Slave_Server_1 ( CLI )
# Checked the same @Slave_server_1 also

4, But in real-time we use Ansible for Master / Slave Configuration instead of using Jenkins CD.

5, Pipelines_Views

  • STEP 5.1 → Create 3 JOBS for this Practicals
  • STEP 5.2 → Sequencing all 4 Jobs
  • STEP 5.3 → Install 3_ Plug-ins ( Del PL, Bld PL, BV PL )
  • STEP 5.4 → Delivery Pipeline View ( Use for Managers )
  • STEP 5.4.1 →Delivery Pipeline View >>>>>>( RESULT )<<<<<<<<<<
  • STEP 5.5 → Build Pipeline View ( Use for DevOps / Developers to see sequencing for Jobs )
  • STEP 5.5.1 →Delivery Pipeline View >>>>>>( RESULT )<<<<<<<<<<
  • STEP 5.6 → Build Monitor ( Purely Support Team )
# Edit the Flow before running this View
# Select all the JOBS
  • STEP 5.6.1 → Build Monitor >>>>>>>>>>RESULT <<<<<<<<<<<<<
# While Induration Cycle this View is very useful

6, Plug-Ins used in my project → “ 8“

( Role-based authorization strategy, Deploy to Container, Backup, Delivery pipeline, Build pipeline, Build Monitor, Prameterised trigger, Git, Maven, Sonnar_Qube )

7, Task → Parameterised Plugin ( You Should Try)

8, >><< Over_all_Jenkins_Class_Topics >><<

  • Intro_Jenkins
  • Installation on Jenkins @ Ubuntu
  • Suggested Plugins
  • Creating of Jobs / Queiung
  • Trigger of Jobs → Time-based trigger / Remote Trigger / Between 2 Jenkins server triggers
  • Creating Users and Assign → GLOBAL_ROLE / ITEM_ROLE ( Role Auth )
  • Enter Jenkins GUI Backup to Jenkins Server CLI ( Backup plugin)
  • Task_1 — — → Cron tab , Webhook & Pool scm, Regex , Downgrade Java
  • Mini-Project (Semi-Automatic deployment to .war file Tomcat_Apache)
  • Tomcat — Config ( Port change, Integration to Jenkins, Users add tomcat, Bug_fix tomcat )
  • Task_2 — — → Email Notification , Jenkins_CLI knowledge
  • Public key / Private Key
  • Master / Slave Configuration
  • Job_run @Master & Job_Excuted @Slave
  • Pipelines Views
  • Task_3 — — →Parameterized trigger plugin -> Input > Job-Output > Input
  • Project → Real_Time_Project ( Via @ SCRIPTED_PIPELINE )

If you want any personal suggestions or a one-to-one call with me, will be more than happy to have one🌿🌾
Let me know on linkedin.com/in/umasankar1993
Now, Take a deep breath and Go get it🌏

#AWS #Docker #Kubernetes #Terraform #Devops #Skills #Roadmap

--

--