Day 23 Task: Jenkins Freestyle Project for DevOps Engineers

Day 23 Task: Jenkins Freestyle Project for DevOps Engineers

Elevating DevOps Workflows: Unleashing Automation with Jenkins Freestyle Projects

ยท

3 min read

๐Ÿ”ถ What is CI/CD?

  • 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.

  • Continuous Delivery is carried out after Continuous Integration to make sure that we can release new changes to our customers quickly 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. Here are a few tasks that you could complete when working with a freestyle project in Jenkins:

๐Ÿ”ถ Task-01

  • Create an agent for your app. ( which you deployed from docker in the earlier task).

  • Create a new Jenkins freestyle project for your app.

    I have cloned the GitHub repos https://github.com/LondheShubham153/django-todo-cicd.git

    gave branch name develop as repos was the default branch name develop.

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

  • By using the ls command we can see the clone repo in our terminal.
    ls /var/lib/jenkins/workspace/your_item_name

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

    To check the port number where the container is running use docker ps
    Please add a rule in your instance security group port number.

-----------------------------------------------------------------------------------

๐Ÿ”ถ 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)

  • 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.

    we have stop the previous container by docker kill container-id and docker rm container-id

In conclusion, the Jenkins Freestyle Project empowers DevOps engineers to automate, integrate, and enhance software development. Its versatility, efficiency, and collaborative features contribute to streamlined workflows and improved software quality. Embracing this tool is crucial for modern DevOps practices, enabling agile and effective development lifecycles.

Stay in the loop with my latest insights and articles on cloud โ˜๏ธ and DevOps โ™พ๏ธ by following me on Hashnode, LinkedIn (https://www.linkedin.com/in/chandreshpatle28/), and GitHub (https://github.com/Chandreshpatle28).

Thank you for reading! Your support means the world to me. Let's keep learning, growing, and making a positive impact in the tech world together.

#Git #Linux Devops #Devopscommunity #90daysofdevopschallenge #python #docker #Jenkins

Did you find this article valuable?

Support Chandresh Patle's Blog by becoming a sponsor. Any amount is appreciated!

ย