Freestyle Jobs
A freestyle job is the classic, form-based way to configure a build using clicks instead of code.
A freestyle project is the simplest kind of Jenkins job. You configure it entirely through web forms — no code required — which makes it great for learning the concepts.
Creating one
- Click New Item on the dashboard.
- Enter a name and choose Freestyle project.
- Configure source code, triggers, and build steps on the config page.
What you can configure
- Source Code Management — point it at a Git repository.
- Build Triggers — decide when it runs.
- Build Steps — the commands to execute.
- Post-build Actions — archive files, send notifications, etc.
Example
# A freestyle job's 'Execute shell' build step is just a script.
# Example contents of that box:
echo "Starting build..."
npm install
npm test
echo "Build finished with status $?"When to use it
- A QA team creates a freestyle job to run a shell script that starts their Selenium test suite against a fixed URL.
- A sysadmin uses a freestyle job to invoke an Ansible playbook without writing any pipeline code.
- A beginner configures their first Jenkins job as a freestyle project to learn job anatomy before moving to pipelines.
More examples
Shell build step in freestyle job
A basic shell build step that installs dependencies and runs tests inside a freestyle job.
#!/bin/bash
# Executed as the 'Execute shell' build step
set -e
echo "Building on $NODE_NAME"
npm install
npm testMaven build step invocation
Mirrors the Maven build step configuration in a freestyle project using the Maven plugin.
# In the freestyle job, under Build Steps:
# 'Invoke top-level Maven targets'
# Maven Version: Maven-3.9
# Goals: clean package -DskipTests=false
mvn clean package -DskipTests=falseArchive output in freestyle job
Combines a Maven build step with the Archive Artifacts post-build action in a freestyle job.
# Build step: Execute shell
mvn package
# Post-build action: Archive the artifacts
# Files to archive: target/*.jar
# Fingerprint: checked
echo "JAR archived from target/"
Discussion