Jnkins  CI/CD Tool

Jnkins CI/CD Tool

Jenkins Tool

  1. Jenkins is the tool which is developed by sun microsystem in 2004 under the name Hudson. Then it named as Jnekins after oracle bought microsystem.

  2. Jenkins is openSouce CI/CD tool which is written in java programming language it can run on any operating system very easily like MacOs , Microsoft and linux os system and it all distributions etc.

  3. CI/CD means continuous Integration and continuous delivery and continuous deployment. Continuous delivery means whenever DevOps engineer or developor has to push button for Deployment and Continuous Deployment means every thing is fully Automated i will fetch code from github.

  4. Continuous Integration means Devops Engineer fetch the code from github build it test it and then deploy it this thing happens continuously it is automated.

  5. It uses docker file and docker compose to build and deployment.

jenkins tool Installation

  1. Firstly you have to Install java for jenkins because as i told you before is that jenkins is written in java.

  2.  sudo apt update
     sudo apt install fontconfig openjdk-17-jre
     java -version
     openjdk version "17.0.13" 2024-10-15
     OpenJDK Runtime Environment (build 17.0.13+11-Debian-2)
     OpenJDK 64-Bit Server VM (build 17.0.13+11-Debian-2, mixed mode, sharing)
    
  3. Then you have to downlode jenkins.

  4.  sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
       https://pkg.jenkins.io/debian/jenkins.io-2023.key
     echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]" \
       https://pkg.jenkins.io/debian binary/ | sudo tee \
       /etc/apt/sources.list.d/jenkins.list > /dev/null
     sudo apt-get update
     sudo apt-get install jenkins
    
  1. Then you also have to install Docker and Docker compose

     sudo apt-get update -y
     sudo apt-get install docker.io
     sudo apt-get install docker-compose
     Systemct start docker
    

WorkFlow of jenkins tool

  1. We can attack git , Selenium ,Maven and diffrent artifact plugin in it as wll it has different different plugins as well

  2. Firstly we fetch the code from githb and then send it to Maven to build it .

  3. Then After that we send to selenium for testing

  4. Then deply it suing docker file and docker compose we can use kubernetes as well

What is Node or Agent

  1. Node is bsically server called slave where jenkins create job and then run it on the slave server. We also can call it Agent.

  2. application can Run on this agents very efficiently.

what is pipeline

  1. Pipelines basically are steps / jobs to build and deploy the application in automated way.

  2. There is one more pipeline called declarative pipeline. This is more efficient and advanced way of implimentation of pipeline

  3. These pipeline we can write in script form and these script uses the Groov syntax.

Advantages of jenkins

  1. It has lot of plugins which can enhance the efficiency to deploy the application.

  2. You also can write and create you plugins

  3. Jenkins is not tool it is framework for doing anything on jenkins you only need the plugins.

  4. jenkins can attack the node /agent and can order them to run the jobs on agents. if agent is not available itself can also do the job

  5. It can also do a crone job. it can reschedule the jobs

  6. it can also create the labels.

FreeStyle project of jenkins

  1. A Freestyle in Jenkins is one of the simplest and most flexible job types. It allows users to define and automate tasks such as building, testing, and deploying applications without requiring complex configurations.

  2. Key Features of a Jenkins Freestyle Project:

    1. Source Code Management (SCM): Supports integration with Git, SVN, and other repositories.

    2. Build Triggers: Can be scheduled, triggered by another job, or initiated via webhooks.

    3. Build Steps: Allows execution of shell scripts, batch commands, or invoking other tools.

    4. Post-Build Actions: Supports actions like archiving artifacts, sending notifications, and triggering other jobs.

When to Use a Freestyle Project?

  1. When you need a quick and simple CI/CD pipeline.

  2. For small projects that don’t require pipeline scripting.

  3. When using GUI-based configurations rather than code-based (e.g., Jenkinsfile).

Limitations:

  1. Less maintainable for complex workflows.

  2. Lacks version-controlled pipeline (unlike Jenkins Pipelines).

  3. Less flexibility in parallel execution and conditional steps.

That’s a wrap on our deep dive into Jenkins! 🚀 Whether you're automating simple builds with Freestyle Projects or managing complex CI/CD workflows with Pipelines, Jenkins remains a powerhouse for DevOps. Keep exploring, keep automating, and let Jenkins handle the heavy lifting! 💪

#Jenkins #CI_CD #DevOps #Automation #BuildDeployAutomate #FreestyleProject #Tech