Creating Freestyle job in Jenkins
Introduction:
Jenkins is a powerful automation server that enables continuous integration and continuous delivery (CI/CD) workflows. One of the fundamental building blocks in Jenkins is the concept of jobs, which are units of work that automate various tasks in your software development process. In this tutorial, we will learn about the process of creating a freestyle job in Jenkins
What is Jenkins Freestyle Project?
A Jenkins Freestyle project is a repeatable build job, script, or pipeline that consists of steps and post-build actions. It is a better function or function that can accomplish multiple tasks. It allows you to configure build triggers and provides project-based security for your Jenkins project. It also offers plugins to help you create steps and post-build actions.
The types of actions you can perform in the Jenkins build phase or post-build action are quite limited. There are several standard plugins available in Jenkins Freestyle projects to help you overcome this problem.
![Creating Freestyle job in Jenkins](https://devopslover.com/wp-content/uploads/2024/02/image-135.png)
How to Set up a Build Job in Jenkins
Step 1: Create a New Freestyle Project
1. Click the New Item link on the left-hand side of the Jenkins dashboard.
![Creating Freestyle job in Jenkins](https://devopslover.com/wp-content/uploads/2024/02/image-136-1024x480.png)
Read Also-DevOps Full Course
Step 2. Enter Item details
- Enter the name of the item you want to create. We shall use the “My Freestyle project” for this demo.
- Select Freestyle project
- Click Okay
![Creating Freestyle job in Jenkins](https://devopslover.com/wp-content/uploads/2024/02/image-137.png)
3.Under the General tab, add a project description in the Description field.
![Creating Freestyle job in Jenkins](https://devopslover.com/wp-content/uploads/2024/02/image-138-1024x428.png)
Step 2: Add a Build Step
1. Scroll down to the Build section.
2. Open the Add build step drop-down menu and select Execute shell.
![Creating Freestyle job in Jenkins](https://devopslover.com/wp-content/uploads/2024/02/image-139.png)
3. Enter the commands you want to execute in the command fields. For this tutorial, we are using a simple set of commands that displays the current version of Java and the Jenkins working directory:
java -version
4. Click the Save button to save changes to the project.
![Creating Freestyle job in Jenkins](https://devopslover.com/wp-content/uploads/2024/02/image-140.png)
Step 3: Build the Project
1. Click the Build Now on the left-hand side of the new project page.
![Creating Freestyle job in Jenkins](https://devopslover.com/wp-content/uploads/2024/02/image-141.png)
2. Click the link to the latest project build in the Build History section.
![Creating Freestyle job in Jenkins](https://devopslover.com/wp-content/uploads/2024/02/image-142.png)
3. Click the Console Output link on the left-hand side to display the output for the commands you entered.
![Creating Freestyle job in Jenkins](https://devopslover.com/wp-content/uploads/2024/02/image-143.png)
4. The console output indicates that Jenkins is executing the command successfully, displaying the current version of Java and the Jenkins working directory.
![Creating Freestyle job in Jenkins](https://devopslover.com/wp-content/uploads/2024/02/image-144-1024x482.png)
- Jacoco - January 3, 2025
- Dependency Track – End To End CI/CD Pipeline - November 29, 2024
- Dependency-track Jenkins Integration - November 27, 2024