Day 23- Mastering Jenkins Freestyle Projects for DevOps Excellence  (Dec 19, 2023)

Day 23- Mastering Jenkins Freestyle Projects for DevOps Excellence (Dec 19, 2023)

Introduction: Embarking on the #90DaysOfDevOps challenge has been an exhilarating journey, and today's task is a golden opportunity for DevOps engineers to showcase their prowess by creating a Jenkins Freestyle Project. In this blog post, we'll explore the core concepts of Continuous Integration (CI) and Continuous Delivery (CD), unravel the significance of Jenkins build jobs, and guide you through two hands-on tasks aimed at honing your skills with Jenkins Freestyle Projects.

Understanding CI/CD: Continuous Integration (CI) is the practice of automating code integration from multiple developers into a central codebase. Frequent commits trigger automated builds and code reviews, facilitating bug detection, seamless code integration, improved software quality, and quicker release cycles.

Continuous Delivery (CD) follows CI and ensures swift, error-free releases to customers. It involves rigorous testing in a staging environment, automating the release process, and maintaining a release-ready product for deployment at any time.

Decoding Jenkins Build Jobs: Jenkins build jobs automate specific tasks in the application building process, encompassing dependency management, compilation, code archiving, transformation, testing, and deployment across diverse environments. Jenkins supports various build job types, including freestyle projects, pipelines, multi-configuration projects, folders, multibranch pipelines, and organization folders.

Unveiling Freestyle Projects in Jenkins: A freestyle project in Jenkins provides a versatile platform for building, testing, and deploying software with diverse configurations. Let's delve into two tasks designed to amplify your mastery of Jenkins Freestyle Projects.

Task-01: Building and Running a Dockerized App

  1. Create an agent for your app: Set up an agent for the app deployed using Docker.

  2. New Jenkins freestyle project: Establish a new project in Jenkins dedicated to your app.

  3. Build Section: In the "Build" section, incorporate a step to execute "docker build," crafting a container image.

  4. Second Step: Introduce a second step to execute "docker run," initiating a container using the created image.

Task-02: Docker Compose for Multi-container Apps

  1. Jenkins Project Setup: Create a Jenkins project with the command "docker-compose up -d" to initiate multiple containers.

  2. Cleanup Step: Implement a cleanup step within the Jenkins project to execute "docker-compose down," gracefully stopping and removing containers.