Day 23 :Jenkins Freestyle Project for DevOps Engineers.

Day 23 :Jenkins Freestyle Project for DevOps Engineers.

ยท

4 min read

What is CI/CD?

Continues Intregration:

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 into 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 Deployment:

Continuous Deployment aims at continuously releasing the code changes into the production environment.

Continuous deployment | Atlassian

Continuous Delivery:

CD or 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.

Understanding Continuous Delivery | TeamCity CI/CD Guide | JetBrains

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 is 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)

  • There are a few steps to creating an agent for an application.

  • first of all, launch the AWS EC2 instance Jenkins Server

  • now connect the terminal with the SSH key.

  • Now go to the Jenkins master server and install the required package for a run to the Jenkins master. click here how to install Jenkins

  1. Now Go to Jenkins dashboard and click on the manage Jenkins and set agent

  1. Now click on Give the node name and click on Permanent click on Create.

  2. Now provide your remote directory location where you want to store the files

  3. node-todo-agent is created

    1. now create a freestyle project

    2. Now give the url github where from you want pull the code

    3. now shell script to build the docker and the docker

      1. click on save and build now.

      2. access this app by using url with exposed port

Task-02

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

Go to the jenkins dashboard and click on new iteam and create freestyle project with the description.

  1. now give the remote directory url

  2. now give the soucre code management url

  1. now click on build steps with shell script and write the script for docker compose.

  2. click on save and build now.

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

So I encourage you to try this on your own and let me know in the comment section about your learning experience

Thank you for reading!

Happy Learning ๐Ÿ˜Š๐Ÿ™Œ

Thank You! Stay Connected โ˜๏ธ๐Ÿ‘ฉโ€๐Ÿ’ป๐ŸŒˆ

Contact me at :

LinkedIn: Akash Singh

linkedin.com/in/akash-singh-48689a176

E-mail:

Did you find this article valuable?

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

ย