Types of Jenkins Jobs
Jenkins supports multiple job types.
Freestyle Project
A simple, click-based job.
Best suited for:
- Running test scripts
- Basic automation tasks
Pipeline
A code-based job using a Jenkinsfile.
Ideal for:
- Complex CI/CD workflows
- Automation pipelines
Multibranch Pipeline
Automatically detects and builds multiple Git branches.
Folder
Used to organize related Jenkins jobs and pipelines.
Interview Line
"Jenkins supports multiple job types. Freestyle jobs are simple and good for basic tasks; Pipeline jobs are more advanced and support CI/CD through code; there are also Multibranch Pipelines for building multiple Git branches."
Freestyle vs Pipeline
The key distinction:
Clicking = Freestyle
Writing Steps as Code = Pipeline
Freestyle Project
A Jenkins job configured using the GUI.
Advantages:
- Easy to create
- Easy to understand
Limitation:
- Hard to maintain
Pipeline
A Jenkins job defined using Pipeline as Code through a Jenkinsfile.
Advantages:
- Scalable
- Reusable
- Supports complex automation workflows
- Version controlled in Git
- Supports parallel test execution
Why It Matters for Testers
- Freestyle jobs are easy but difficult to maintain.
- Pipelines are scalable and reusable.
- Pipeline code can be stored in Git.
- Pipelines support parallel execution.
Real Project Recommendation
Pipeline is preferred in real projects.
A Freestyle job is configured completely through the Jenkins UI.
A Pipeline job is created by defining a Jenkinsfile in Git with stages (covered in Cluster 4).
Configuring a Jenkins Job
Configuring a Jenkins job means defining the settings and execution steps that Jenkins performs.
General
Defines:
- Job Name
- Description
Source Code Management
Defines:
- Git Configuration
Build Triggers
Defines:
- When the job executes
Build Steps / Stages
Defines:
- What Jenkins executes
Post-Build Actions
Defines:
- Reports
- Notifications
Interview Line
"Configuring a Jenkins job involves defining source-code details, build steps, triggers, and post-build actions. In my project, I configured build steps, integrated Selenium and API tests, set up triggers, and published reports."
Triggering a Job Manually
Manually triggering a Jenkins job means starting the job yourself instead of relying on automatic triggers.
Manual execution provides full control and is useful for:
- Re-running jobs
- On-demand execution
Build Now
One-click execution.
Typically used for:
- Freestyle Jobs
Build with Parameters
Run a parameterized job using custom inputs.
Build Triggers
Build triggers determine when Jenkins starts a job.
Purpose
Triggers automatically start builds based on specific conditions or events.
The analogy from your notes is a school bell.
Manual Trigger
User clicks:
- Build Now
SCM Polling
Jenkins periodically checks Git repositories for changes.
Git Webhook
Git automatically notifies Jenkins whenever code is pushed.
Scheduled (CRON)
Runs jobs according to a predefined schedule.
(Discussed in Cluster 3.)
Upstream Job Completion
One completed job automatically triggers another job.
Note
A single Jenkins job can use multiple triggers.
Example:
- Git Webhook
- Manual Trigger
Build with Parameters
Build with Parameters allows Jenkins jobs to execute using custom input values instead of fixed values.
Parameters are supplied when the job is triggered.
Common Parameter Types
- String
- Choice
- Boolean
Example
Select:
- Browser
- Environment
before executing a Selenium automation suite.
Related Job Controls
Re-run a Failed Build
Use:
- Build Now
- Rebuild
Stop a Running Job
Use:
- Red Stop Button
- Abort
FAQs
What Are the Main Jenkins Job Types?
Jenkins supports:
- Freestyle Project
- Pipeline
- Multibranch Pipeline
- Folder
What Is the Difference Between Freestyle and Pipeline?
Freestyle
- GUI-Based Configuration
- Easy to Create
- Hard to Maintain
Pipeline
- Jenkinsfile
- Pipeline as Code
- Scalable
- Reusable
- Stored in Git
- Supports Parallel Execution
Pipeline is preferred for real-world projects.
What Sections Are Included in Jenkins Job Configuration?
A Jenkins job configuration includes:
- General
- Source Code Management
- Build Triggers
- Build Steps / Stages
- Post-Build Actions
How Do You Trigger a Jenkins Job Manually?
Use:
- Build Now
- Build with Parameters
What Are Build Triggers?
Build triggers automatically start Jenkins jobs based on:
- Manual Execution
- SCM Polling
- Git Webhooks
- Scheduled (CRON)
- Upstream Job Completion
A single job can use multiple triggers.
What Is Build with Parameters?
Build with Parameters allows custom input values such as:
- String Parameters
- Choice Parameters
- Boolean Parameters
Example:
- Browser Selection
- Environment Selection
before executing automation tests.