Day-22 : Getting Started with Jenkins

Day-22 : Getting Started with Jenkins

ยท

3 min read

What is Jenkins?

Jenkins is an open-source automation server used for building, testing, and deploying software. It facilitates continuous integration and continuous delivery (CI/CD) by automating the repetitive tasks involved in the software development process. Jenkins supports the automation of building, testing, and deploying code changes, which helps teams deliver software more efficiently and reliably.

What is CI/CD?

CI/CD stands for Continuous Integration and Continuous Delivery/Continuous Deployment. It is a set of practices, often supported by automation tools, that aims to enhance the efficiency and reliability of software development and delivery.

  1. Continuous Integration (CI):

    Objective: To integrate code changes from multiple contributors into a shared repository frequently, typically several times a day.

    Process: Developers submit their code changes to a version control system (e.g., Git). Automated builds and tests are triggered whenever changes are committed.

    Benefits:

    • Early detection of integration issues.

    • Faster identification and resolution of bugs.

    • Ensures that the codebase is always in a functional state.

  2. Continuous Delivery (CD):

    Objective: To ensure that the software is always in a releasable state, and it can be deployed to production or any other environment at any time.

    Process: After successful CI, the code is automatically deployed to a staging or pre-production environment. The deployment to production is usually a manual decision.

    Benefits:

    • Allows for more frequent and reliable releases.

    • Reduces the time and effort required for manual deployment.

    • Provides the flexibility to release when business requirements dictate.

  3. Continuous Deployment (CD):

    Objective: To automate the entire deployment process, including the release to production, without manual intervention.

    Process: After successful CI, the code is automatically deployed to production without manual approval.

    Benefits:

    • Enables rapid and automated delivery of new features and bug fixes.

    • Reduces the risk of human error in the deployment process.

In summary, CI focuses on integrating code changes and running automated tests, ensuring a functional codebase. CD extends this process to ensure that the software is always in a releasable state and can be deployed with minimal manual intervention. Continuous Deployment takes it a step further by automating the deployment to production. Together, CI/CD practices aim to streamline the development and delivery pipeline, making it more efficient, reliable, and responsive to changing requirements.

๐Ÿ’ผTask :

Create a freestyle pipeline to print "Hello World!!"

Step 1 : Install Jenkins on EC2 instance Installation Link

Step 2: Allow port 8080 on the EC2 instance

Step 3: Unlock Jenkin, complete the initial setup you will get an interface like this below

Step 4: Click on the "New Item" button on the sidebar

Step 5: Give your project a name, select "Freestyle project" as the job type and click on the "OK" button

Step 6: on the configuration page, you can specify the source code management, build triggers, build environment, and build steps

Step 7: on the configuration page In the Build Steps section we have an option Execute Shell by which we can write some Shell commands

Step 8: To print a hello world job you have to write a simple shell script with echo command

Step 9 : Click on the Save button to create the project, now click on Build Now to run the project

Step 10: Check the console output

Successfully Created a freestyle pipeline to print "Hello World!!

๐Ÿ“ Conclusion :

In this blog, we cover Jenkins the CI/CD process & its benefits, we have created a freestyle pipeline to print "Hello World!!. In the next blog, we will cover some advance topics.

Thank you for reading!

Contact me on Linkedin ๐Ÿค

Check out my GitHub for more resources ๐Ÿ“š

ย