Day 23 Task: Jenkins Freestyle Project for DevOps Engineers.

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 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.
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.
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.
To implement Continuous Deployment in Jenkins you need to set various pipelines that will consist of Several Stages which include the following:
A) Build
B) Stage
C) Deploy (Deployment)
D) Monitor
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:
Now Let us Discuss the Free Style Projects:- with Tasks
Task -01
Create a new Jenkins freestyle project for you app using.
1 Log into Jenkins and navigate the main dashboard:-
Syntax: ipaddress:8080 with username and Password (discuss in the previous article)
2 Click on the "New item" button to create a new Project.
Jenkins Dashboard Diagram.
3 Select "Free style" and give the project name.
4 Now click on the OK button to create a new project.(I will give node-app-pipeline).
Now click on the OK button to create a new project.(I will give node-app-pipeline Diagram.
In the Project Configuration page in Left Side General you can specify the details (Description) of your project.such as Description, Source code management,Build Triggers, Build Environment,build steps and for git hub repository enter the URL of git hub repository. I will use the git hub repository link.Now in the git hub projects Project URL enter your URL. and saved on it.
Enter the Github link Diagram.
Next step, In the "Source code management" section you can be specify the repository Branches to build option Branch specifier enter the \/main.*
Source code management" section you can be specify the repository Branches Diagram.
In the "Build section" of project add a build to run the "docker build -t node-app .
In the "Build section" of project add a build to run the "docker build -t node-app .
Add a second step to run the "docker run" command to start a container using the image created in step 3.
docker build -t node-app .
docker run -d --name node-todo-app -p 8080:8080 node-app:latest
docker run" command to start a container (docker run -d --name node-todo-app -p 8080:8080 node-app:latest) Diagram.
Click on the "save" button to save the Project Configuration.
Now it's time to build the project by clicking on the "Build Now".This will start the build process and execute the steps specified in the project configuration.
Build Now Digram.
Thank you for Reading this article!! Stay connected
Happy Learning


