Day 23: Jenkins Freestyle Project for DevOps Engineers

Day 23: Jenkins Freestyle Project for DevOps Engineers

Greetings, DevOps enthusiasts! Today, we embark on an exciting journey of creating Jenkins Freestyle Projects, an excellent opportunity to showcase our skills in automation. Let's dive in and conquer the world of continuous integration and delivery.

Task-01: Building and Running a Dockerized App

Step 1: Create an Agent for Your App

Firstly, let's set the stage by deploying our application using Docker. This involves creating an agent in Jenkins.

  1. Navigate to Jenkins Dashboard:

    • Open your Jenkins dashboard in a web browser.
  2. Create a New Node:

    • Go to "Manage Jenkins" > "Manage Nodes and Clouds" > "New Node."

    • Define a node name and choose "Permanent Agent."

    • Configure the connection settings and save.

Step 2: New Jenkins Freestyle Project

Now, let's set up a new Jenkins Freestyle Project for our Dockerized app.

  1. Create a New Jenkins Freestyle Project:

    • Click on "New Item" in the Jenkins dashboard.

    • Enter a project name, choose "Freestyle project," and click "OK."

  2. Configure the Project:

    • In the project configuration, go to the "Build" section.

    • Add a build step by choosing "Execute shell" and enter the "docker build" command.

  3. Add Second Step:

    • Add another build step to run the "docker run" command to start the container using the built image.

Task-02: Docker-Compose Magic

Step 1: Jenkins Project Setup

Now, let's leverage Docker-Compose for orchestrating multiple containers.

  1. Create a Jenkins Project:

    • Create a new Jenkins project using the same procedure as in Task-01.

    • Configure the build step to run "docker-compose up -d."

  2. Cleanup Step:

    • Add a cleanup step in the project configuration to run "docker-compose down" for stopping and removing containers.

Wrapping Up

Congratulations! You've successfully created Jenkins Freestyle Projects, integrating Docker into your CI/CD workflows. This hands-on experience enhances your automation skills, setting the stage for more complex DevOps tasks. Keep pushing your limits, and happy coding!

Explore the screenshots below for a visual guide:

Installing The jenkins along with Java

Created the Two Django app Job using Docker Compose up

Check the Console Output if any error occurs

Check the console output if any error appears

Feel free to refer to the detailed screenshots as you navigate through the tasks. Happy coding, and let the DevOps journey continue!

#DevOps #Jenkins #CI_CD #Automation #90DaysOfDevOps