A Freestyle job is a simple and flexible Jenkins project type that allows you to configure build steps, triggers, and post-build actions without complex scripting.
Click to reveal answer
beginner
Name the first step to create a Freestyle job in Jenkins.
Click on 'New Item' in Jenkins dashboard, enter a job name, select 'Freestyle project', and click OK.
Click to reveal answer
beginner
Which section in a Freestyle job lets you add commands to run during the build?
The 'Build' section lets you add build steps like executing shell commands or running scripts.
Click to reveal answer
intermediate
How can you trigger a Freestyle job automatically in Jenkins?
By configuring 'Build Triggers' such as polling SCM, scheduled builds, or triggering remotely via URL.
Click to reveal answer
intermediate
What is the purpose of 'Post-build Actions' in a Freestyle job?
They define tasks to run after the build, like sending notifications, archiving artifacts, or triggering other jobs.
Click to reveal answer
What type of Jenkins job is best for simple build and test tasks without complex pipelines?
APipeline job
BFreestyle job
CMultibranch pipeline
DFolder job
✗ Incorrect
Freestyle jobs are designed for simple and flexible build configurations without scripting.
Where do you add shell commands to run in a Freestyle job?
ABuild section
BPost-build Actions
CBuild Triggers
DSource Code Management
✗ Incorrect
The Build section is where you add commands or scripts to execute during the build.
Which option allows a Freestyle job to run automatically on a schedule?
ASource Code Management polling
BPost-build Actions
CManual build only
DBuild Triggers with 'Build periodically'
✗ Incorrect
The 'Build periodically' trigger schedules the job to run at set times.
What is NOT a typical post-build action in a Freestyle job?
ASend email notifications
BArchive build artifacts
CAdd build steps
DTrigger another job
✗ Incorrect
Adding build steps is done in the Build section, not post-build actions.
How do you start creating a new Freestyle job in Jenkins?
AClick 'New Item', enter name, select 'Freestyle project', then OK
BClick 'Manage Jenkins', then 'New Job'
CUse Jenkins CLI only
DCreate a Jenkinsfile
✗ Incorrect
The standard way is to click 'New Item', name the job, select 'Freestyle project', and confirm.
Describe the steps to create and configure a basic Freestyle job in Jenkins.
Think about the sequence from starting a new job to saving it.
You got /8 concepts.
Explain how build triggers work in a Freestyle job and give examples.
Triggers help Jenkins know when to run the job.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of a freestyle job in Jenkins?
easy
A. To monitor server hardware status
B. To create complex pipelines with multiple stages
C. To manage Jenkins user permissions
D. To run simple automated tasks configured via the Jenkins UI
Solution
Step 1: Understand freestyle job basics
Freestyle jobs are designed for simple automation tasks in Jenkins, easy to set up through the UI.
Step 2: Compare options
Monitoring server hardware, creating complex pipelines, and managing user permissions are other Jenkins features or unrelated tasks, not freestyle jobs.
Final Answer:
To run simple automated tasks configured via the Jenkins UI -> Option D
Quick Check:
Freestyle job = simple automation [OK]
Hint: Freestyle jobs are for simple tasks, not complex pipelines [OK]
Common Mistakes:
Confusing freestyle jobs with pipeline jobs
Thinking freestyle jobs manage users or hardware
Assuming freestyle jobs require scripting
2. Which of the following is the correct way to start creating a freestyle job in Jenkins?
easy
A. Go to 'Manage Jenkins' and select 'Create Freestyle Job'
B. Run the command 'jenkins create freestyle' in the terminal
C. Click 'New Item', enter a name, select 'Freestyle project', then click OK
D. Edit the Jenkinsfile to add a freestyle job
Solution
Step 1: Recall Jenkins UI steps
To create a freestyle job, you click 'New Item', name it, choose 'Freestyle project', and confirm.
Step 2: Eliminate incorrect options
Going to 'Manage Jenkins', running terminal commands, and editing a Jenkinsfile are not how freestyle jobs are created.
Final Answer:
Click 'New Item', enter a name, select 'Freestyle project', then click OK -> Option C
Quick Check:
Create freestyle job = New Item + Freestyle project [OK]
Hint: Start with 'New Item' and pick 'Freestyle project' [OK]
Common Mistakes:
Looking for freestyle job creation in 'Manage Jenkins'
Trying to create freestyle jobs via terminal commands
Editing Jenkinsfile instead of using UI
3. Given a freestyle job configured to run a shell command echo Hello Jenkins, what will be the output in the build console?
medium
A. Hello Jenkins
B. echo Hello Jenkins
C. Error: command not found
D. Build failed
Solution
Step 1: Understand shell command execution in freestyle job
The shell command echo Hello Jenkins prints the text 'Hello Jenkins' to the console.
Step 2: Analyze output options
'Hello Jenkins' matches the expected output. 'echo Hello Jenkins' shows the command itself, which is not the output. Error and build failure do not occur here.
Final Answer:
Hello Jenkins -> Option A
Quick Check:
echo command prints text [OK]
Hint: echo prints text, not the command itself [OK]
Common Mistakes:
Confusing command output with command text
Assuming shell commands fail without reason
Expecting build failure without errors
4. You created a freestyle job but the build fails immediately with 'No such file or directory' error when running a shell command. What is the most likely cause?
medium
A. The freestyle job was not saved properly
B. The shell command references a file that does not exist on the Jenkins agent
C. Jenkins server is offline
D. The job type should be pipeline, not freestyle
Solution
Step 1: Understand the error message
'No such file or directory' means the shell command tries to access a missing file on the Jenkins agent machine.
Step 2: Evaluate other options
The freestyle job was not saved properly is unlikely because saving issues cause different errors. Jenkins server is offline would prevent any build start. The job type should be pipeline, not freestyle is unrelated to file errors.
Final Answer:
The shell command references a file that does not exist on the Jenkins agent -> Option B
Quick Check:
File missing on agent = 'No such file' error [OK]
Hint: Check file paths on Jenkins agent for shell commands [OK]
Common Mistakes:
Assuming job type causes file errors
Ignoring agent environment differences
Thinking Jenkins server offline causes this error
5. You want to create a freestyle job that triggers automatically every day at 2 AM and runs a shell script. Which configuration steps are needed?
hard
A. Set 'Build Triggers' to 'Build periodically' with schedule '0 2 * * *' and add shell command in 'Build' section
B. Add a cron job on the Jenkins server to run the job at 2 AM
C. Configure 'Poll SCM' with schedule '0 2 * * *' and add shell command in 'Post-build Actions'
D. Use 'Build after other projects are built' trigger and add shell command in 'Build' section
Solution
Step 1: Identify correct trigger for scheduled builds
In freestyle jobs, 'Build periodically' with cron syntax schedules automatic runs at specified times.
Step 2: Place shell command in the 'Build' section
The shell script should be added under 'Build' steps, not post-build or external cron.
Final Answer:
Set 'Build Triggers' to 'Build periodically' with schedule '0 2 * * *' and add shell command in 'Build' section -> Option A
Quick Check:
Scheduled build = 'Build periodically' + shell in 'Build' [OK]
Hint: Use 'Build periodically' with cron for scheduled freestyle jobs [OK]
Common Mistakes:
Using external cron instead of Jenkins triggers
Putting shell commands in post-build actions
Confusing 'Poll SCM' with scheduled builds
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.