0
0
Jenkinsdevops~10 mins

Freestyle job creation in Jenkins - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Freestyle job creation
Open Jenkins Dashboard
Click 'New Item'
Enter Job Name
Select 'Freestyle project'
Configure Job Settings
Save Job
Run Job
View Console Output
This flow shows the step-by-step process to create and run a freestyle job in Jenkins.
Execution Sample
Jenkins
1. Open Jenkins Dashboard
2. Click 'New Item'
3. Enter job name 'MyJob'
4. Select 'Freestyle project'
5. Configure build steps
6. Save and run job
This sequence creates a freestyle job named 'MyJob', configures it, saves, and runs it.
Process Table
StepActionInput/SelectionResult/State Change
1Open Jenkins DashboardN/ADashboard page loads
2Click 'New Item'N/A'Create a new job' page opens
3Enter job name'MyJob'Job name field set to 'MyJob'
4Select job type'Freestyle project'Freestyle project selected
5Configure jobAdd build step: Execute shell 'echo Hello'Build step added
6Save jobClick 'Save'Job 'MyJob' created and saved
7Run jobClick 'Build Now'Job 'MyJob' starts running
8View outputOpen 'Console Output'Console shows 'Hello' output
9ExitJob finishedJob run completed successfully
💡 Job run completes and console output is available
Status Tracker
VariableStartAfter Step 3After Step 5After Step 6After Step 7Final
Job NameNoneMyJobMyJobMyJobMyJobMyJob
Job TypeNoneNoneFreestyle projectFreestyle projectFreestyle projectFreestyle project
Build StepsEmptyEmptyExecute shell 'echo Hello'Execute shell 'echo Hello'Execute shell 'echo Hello'Execute shell 'echo Hello'
Job StatusNot createdNot createdNot createdCreatedRunningCompleted
Key Moments - 3 Insights
Why do we need to select 'Freestyle project' after entering the job name?
Selecting 'Freestyle project' defines the type of job Jenkins will create. Without this, Jenkins cannot configure the job properly. See execution_table step 4.
What happens if we don't add any build steps before saving?
The job will be created but running it will do nothing because no tasks are defined. See execution_table step 5 for adding build steps.
How do we know the job ran successfully?
By checking the console output after running the job, which shows the expected output. See execution_table step 8.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the job status after step 6?
ARunning
BNot created
CCreated
DCompleted
💡 Hint
Check the 'Job Status' variable in variable_tracker after step 6
At which step does the console output become available?
AStep 8
BStep 7
CStep 6
DStep 5
💡 Hint
Look at execution_table row for viewing output
If you skip selecting 'Freestyle project', what will happen?
AJob will be created as freestyle by default
BJenkins will not allow saving the job
CJob will run but no output
DJob will be created but with errors
💡 Hint
Refer to key_moments about selecting job type (step 4)
Concept Snapshot
Freestyle Job Creation in Jenkins:
1. Open Jenkins Dashboard
2. Click 'New Item' and enter job name
3. Select 'Freestyle project' as job type
4. Configure build steps (e.g., shell commands)
5. Save the job
6. Run the job and view console output
Key: Selecting job type is mandatory before saving.
Full Transcript
To create a freestyle job in Jenkins, start by opening the Jenkins dashboard. Click on 'New Item' to create a new job. Enter a name for your job, for example, 'MyJob'. Then select 'Freestyle project' as the job type. Configure the job by adding build steps such as executing shell commands. Save the job to create it. After saving, you can run the job by clicking 'Build Now'. Once the job runs, view the console output to see the results. The job status changes from not created to created, then running, and finally completed. Selecting the job type is essential before saving, or Jenkins will not allow the job to be saved. If no build steps are added, the job will run but perform no actions. Checking the console output confirms the job ran successfully.