Day23 of #90DaysOfDevOps Challenge

Jenkins – Freestyle Project

Day23 of #90DaysOfDevOps Challenge

❄️CI/CD

Continuous integration and continuous delivery help in automating the software development lifecycle stages, doing bug fixes and hotfixes, faster release cycles, and isolating different environments like development, testing, staging, and production.

In CI, different developers commit new changes to the source code repo and the pipeline checks out the source code from the repository. It installs all the required dependencies, then the build stage builds the executable artifact, and required testing is performed for the application and archives it.

The CD deploys the artifact to different stages and that is how the CI-CD pipeline runs continuously.


❄️Task-01

  • create an agent for your app.

Create a new node -

No alt text provided for this image

Provide a path to configure the Jenkins node in the Host machine -

No alt text provided for this image

No alt text provided for this image

Now click on the created agent, and it will give the commands required to download the agent.jar file and connect the agent to Jenkins -

No alt text provided for this image

Now run the above commands on the machine where you are configuring the agent.

And My agent is now online -

No alt text provided for this image

  • Create a new Jenkins freestyle project for your app.

No alt text provided for this image

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

  • Add a second step to run the “docker run” command to start a container using the image created in step 3.

Add the repo where the application code is saved and restrict the job to run on our new agent1 -

No alt text provided for this image

No alt text provided for this image

Now add the steps to build the image and run the container -

No alt text provided for this image

Build the job. The job was successful -

No alt text provided for this image

The image is ready, and the container is running -

No alt text provided for this image

And my App is also running -

No alt text provided for this image

❄️Task-02

  • Create Jenkins project to run the “docker-compose up -d” command to start the multiple containers defined in the compose file (Hint- use day-19 Application & Database docker-compose file)

No alt text provided for this image

No alt text provided for this image

  • Set up a cleanup step in the Jenkins project to run the “docker-compose down” command to stop and remove the containers defined in the compose file.

No alt text provided for this image

No alt text provided for this image

No alt text provided for this image


Thank you for reading! 📘