Master Jenkins From Beginner to Enterprise

Clear, interactive, and structured Jenkins lessons designed to take you from beginner to enterprise level.

Freestyle Projects

Learn the concepts, configuration workflows, and GUI steps required to build, orchestrate, and execute standard Freestyle build jobs.

What is a Freestyle Project?

A Freestyle Project is the foundational, web-based build job type offered by Jenkins. Unlike modern Jenkinsfiles that rely on Groovy code logic, a Freestyle Project allows administrators to configure build steps, Source Code Management tracking, security flags, and trigger hooks entirely using the **Jenkins Web Graphical Interface**.

Core Definition: A highly configurable, UI-driven automation job suitable for simple continuous integration tasks, script executions, and legacy automation tasks.

Key Elements of a Freestyle Configuration

1. Source Code Management (SCM)

Links the project workspace directly to an external code repository (like Git or Subversion) to pull down code before compiling.

2. Build Triggers

Defines automated event hooks that launch the job, such as webhooks, cron-based scheduling expressions, or polling modifications.

3. Build Steps

The operational heart of the item. Directs Jenkins to run specific tasks like shell script lines (bash), Windows batch sequences, or Maven build goals.

4. Post-build Actions

Tasks triggered immediately after execution wraps up, such as sending emails, archiving compiled artifacts, or initiating downstream jobs.

Step-by-Step: How to Create a Freestyle Project

  1. Open the main Jenkins Dashboard and click **New Item** from the left navigation menu.
  2. Enter a unique identifier name for your project inside the input field.
  3. Select the card option explicitly labeled Freestyle project.
  4. Scroll down to the footer actions block and click the OK confirmation button to load the properties workspace page.
  1. Locate the Build Steps tab section down the configuration form page.
  2. Click the Add build step dropdown button and choose Execute shell (or Execute Windows batch command).
  3. Type your target command script logic inside the exposed configuration block.
  4. Click the green Save button to write configurations to disk storage.

Typical Build Step Command Hook

Instead of declarative syntax files, standard shell configurations execute directly inside the execution environment workspace like this:

# Basic compilation checks run during UI Freestyle build execution stages
echo "Running automated integration check tasks..."
npm install
npm test
echo "Build step completed successfully!"

Practice Exercise: Your First UI Automation Job

Task Objective:

Create a basic upstream project that logs custom messages and simulates code production directly from your local Jenkins installation.

  • Spin up a Freestyle job named System-Diagnostic-Check.
  • Add an Execute Shell component to output system parameters (e.g., uname -a or hostname).
  • Configure a Post-build Action to archive any resultant .log or text files.

Knowledge Check

Question: Where is the primary configuration for a Freestyle Project stored and managed?
A. In a file named Jenkinsfile tracked in a git repository.
B. Exclusively via the Jenkins web UI and saved as an XML configuration file on the controller disk storage.
C. Inside an infrastructure playbook managed by tools like Terraform or Ansible.

Summary

You have completed the Freestyle Projects lesson. Continue through the syllabus to learn the differences between UI-driven jobs and code-defined pipelines.