Jenkins CICD

Jenkins CICD

Jenkins Blue Ocean is a modern user interface (UI) extension for Jenkins that provides an enhanced and user-friendly experience for visualizing, editing, and managing Continuous Integration/Continuous Deployment (CI/CD) pipelines. It aims to make it easier for both developers and non-developers to work with Jenkins pipelines. Here are some key features and concepts related to Jenkins Blue Ocean:

  1. Visual Pipeline Editor: Blue Ocean offers a visual pipeline editor that allows you to create and edit Jenkins pipelines using a graphical interface. This makes it easier to design and understand complex pipeline workflows.

  2. Pipeline Visualization: Pipelines are displayed as a series of interconnected steps and stages, providing a clear and intuitive view of the CI/CD process. You can see the status of each stage and easily identify any issues.

  3. Personalization: Blue Ocean provides a personalized dashboard where users can organize and view their favorite pipelines. It allows you to customize your dashboard to display the pipelines that matter most to you.

  4. Integrated Code Repository: Blue Ocean integrates with popular version control systems like Git and provides a seamless experience for configuring and running pipelines based on code changes.

  5. Real-time Feedback: The UI provides real-time feedback on pipeline execution, showing progress, test results, and logs as they happen.

  6. Parallel and Sequential Execution: You can define parallel and sequential execution of pipeline stages, making it easy to optimize your CI/CD workflows.

  7. GitHub Integration: Blue Ocean has built-in integration with GitHub, making it simple to trigger pipelines based on GitHub events, such as code pushes or pull requests.

  8. Extensible: Jenkins Blue Ocean is extensible, allowing you to create custom pipeline templates and integrations to suit your specific needs.

Lets get started with Jenkins Installation and setting up blue ocean:

  1. Create an EC2 instance in AWS or you may go for other cloud as well as we are going to install and run jenkins in VM.

    Now make a connection to this VM using ssh,

  2. Note down the below commands to install Jenkins,

     sudo apt-get update -y
    
     sudo apt install fontconfig openjdk-17-jre  # as java is the pre-requisite to run jenkins
    
     java -version
    
     curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee   /usr/share/keyrings/jenkins-keyring.asc > /dev/null
    
     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 update -y
    
     sudo apt install Jenkins -y
    
  3. Now open 8080 port of your VM

  4. Copy the VM public ip and paste it in URL in the below format,

    https://<Public_IP>:8080/

    Copy the above path and cat it in the terminal to find the password and click on continue,

  5. We need to install Blue ocean theme now.

    Go to Manage Jenkins > Plugins > Available Plugins > Type "Blue Ocean" > Install

  6. Now Blue Ocean is installed. Click on blue ocean logo from jenkin's dashboard

    or type url in below format to use Jenkins blue,

    https://<VM_PublicIP>:8080/blue/

  7. Now we need to choose one of the repository and need to create access token.

  8. Creating access token in github,

    github repo > your profile > Click on your profile place right top corner > Settings > Developer Settings > Tokens(classic) > Generate new token

  9. Now paste the token in jenkins where it is asking for access token.

    It will then display your github profile and then the projects in the repository.

  10. I have chosen a project with No Jenkinsfile

  11. Jenkins automatically detected that i don't have jenkinsfile in my project and asked to create a pipeline using UI

    . And then jenkins will create the jenkinsfile into my project.

    Now below screenshot the jenkinsfile is created,

  12. Now after clicking on build we can download the build log as well.