Day 23 : Jenkins Freestyle Project for DevOps.

Day 23 : Jenkins Freestyle Project for DevOps.

Today we have created a Freestyle Project with Jenkins + Docker using CI-CD pipeline.

Today's challenge is particularly exciting as it entails creating a Jenkins Freestyle Project, an opportunity for DevOps engineers to showcase their skills and push their limits.

What is CI/CD?

  • CI or Continuous Integration is the practice of automating the integration of code changes from multiple developers into a single codebase. It is a software development practice where the developers commit their work frequently to the central code repository (Github or Stash). Then there are automated tools that build the newly committed code and do a code review, etc as required upon integration.

  • The key goals of Continuous Integration are to find and address bugs quicker, make the process of integrating code across a team of developers easier, improve software quality and reduce the time it takes to release new feature updates.

  • CD or Continuous Delivery is carried out after Continuous Integration to make sure that we can release new changes to our customers quickly and in an error-free way. This includes running integration and regression tests in the staging area (similar to the production environment) so that the final release is not broken in production. It ensures to automate the release process so that we have a release-ready product at all times and we can deploy our application at any point in time.

What Is a Build Job?

  • A Jenkins build job contains the configuration for automating a specific task or step in the application building process. These tasks include gathering dependencies, compiling, archiving, or transforming code, and testing and deploying code in different environments.

  • Jenkins supports several types of build jobs, such as freestyle projects, pipelines, multi-configuration projects, folders, multibranch pipelines, and organization folders.

What are Freestyle Projects ?

A freestyle project in Jenkins is a type of project that allows you to build, test, and deploy software using a variety of different options and configurations.


Task-01

Create a new Jenkins freestyle project for your app.

Screenshot from 2023-04-05 15-54-04

Screenshot from 2023-04-05 15-46-29

Screenshot from 2023-04-05 15-46-39

In the "Build" section of the project, add a build step to run the "docker build" command to build the image for the container.

Screenshot from 2023-04-05 15-49-03


Final Output:

Build Successful

Screenshot from 2023-04-05 15-53-41

Console Output

Screenshot from 2023-04-05 15-51-52

Screenshot from 2023-04-05 15-52-24


Docker Check pull of the image is correct or not.

Screenshot from 2023-04-05 15-54-39

Screenshot from 2023-04-05 15-54-33


Task-02

- Create a Jenkins project to run the "docker-compose up -d" command to start the multiple containers defined in the compose file

docker-compose.yaml file

Screenshot from 2023-04-05 17-49-51

Screenshot from 2023-04-05 17-42-48

Screenshot from 2023-04-05 17-42-58

Execute Shell

Screenshot from 2023-04-05 17-43-02


Final Output:

Screenshot from 2023-04-05 17-42-34

Screenshot from 2023-04-05 17-43-23

Screenshot from 2023-04-05 17-43-35


Docker Check pull of the image is correct or not.

Screenshot from 2023-04-05 17-44-28

Screenshot from 2023-04-05 17-44-11


Happy Learning :)

Did you find this article valuable?

Support DevOps by becoming a sponsor. Any amount is appreciated!