Chapter 05Lesson 03~100 minutes

Freestyle Projects, Build Steps, Post-Build Actions, Parameters, Triggers, and Legacy Job Maintenance: Configuration, Design Choices, and Tradeoffs

Evaluate whether a legacy Freestyle job should remain UI-managed, move logic into SCM, migrate to Pipeline, or be retired, using explicit dependency and rollback evidence.

Design choicesMigrationPlugin governanceSCMRollback

Learning objectives

  • Compare controller-stored Freestyle configuration with versioned Pipeline and repository scripts.
  • Decide when to maintain, migrate, or retire a legacy job based on operational risk rather than fashion.
  • Identify hidden plugin and chaining dependencies before changing a job.
  • Write a behavior contract that can validate a migration without requiring identical implementation.
  • Define rollback requirements that include core, Java, plugins, agents, credentials references, and external state.

1. Migration is a risk decision, not a style contest

A Freestyle job may be stable, well-owned, and easy to recover, or it may be an opaque collection of UI settings accumulated over years. The decision to maintain or migrate should be based on change frequency, auditability, plugin risk, failure isolation, ownership, and the cost of proving equivalent behavior.

The safest migration often starts with an inventory and a behavior contract, then moves scripts into SCM before moving orchestration. That creates reviewable changes without forcing a big-bang rewrite.

2. Controller-stored configuration versus SCM

Dimension Freestyle/UI-managed Pipeline/Jenkinsfile or versioned scripts
Change review Depends on Jenkins permissions and external snapshots Normal SCM review and history
Rollback Restore configuration snapshot or manually revert Revert a reviewed commit, subject to runtime compatibility
Portability Coupled to controller/plugins and item XML Higher when logic and scripts are versioned; still depends on Jenkins/plugins/agents
Discoverability Behavior can be spread across tabs and plugins Orchestration is visible near source; external configuration still exists
Emergency edit Fast through UI but easier to drift Requires code change process unless explicitly designed otherwise

Pipeline-as-Code does not eliminate controller configuration. Credentials, agents, plugins, global libraries, security, and system settings remain external dependencies. Migration simply moves the workflow definition into a form that is easier to review and version.

3. Maintain Freestyle versus migrate to Jenkinsfile

Maintain temporarily when the job is simple, low-risk, rarely changed, has healthy dependencies, and has a tested backup/recovery path. Migrate sooner when the job is multi-stage, frequently edited, security-sensitive, dependent on many publishers, hard to test, or tightly coupled to other jobs.

Useful intermediate step: move large shell or PowerShell bodies out of Jenkins configuration and into reviewed repository scripts first. A Freestyle job can call those scripts while orchestration migration is planned later.

4. Chained jobs versus one explicit Pipeline

Legacy installations often chain Freestyle jobs through upstream/downstream triggers or publisher plugins. This can work, but the complete dependency graph becomes difficult to see because each job stores only part of the orchestration.

A Pipeline can make ordering and failure propagation explicit in one versioned definition, but moving everything into one Pipeline is not automatically better. Large pipelines can become tightly coupled, long-running, or over-privileged. Preserve independently owned boundaries where they represent real products or security domains.

5. Generic build steps versus plugin-specific publishers

Every plugin-specific publisher is an executable dependency that must remain compatible with the Jenkins core, Java runtime, controller security model, and its own stored configuration. Before relying on one, record its plugin ID, exact version, minimum Jenkins requirement, maintenance/security status, and the behavior you actually need.

The mandatory chapter lab uses the core artifact archiver precisely to avoid adding unnecessary plugin state. If a legacy job sends mail, uploads packages, posts commit status, or deploys through a plugin, migration should separate the business requirement from the particular plugin implementation.

6. Inventory plugin dependency before touching the job

Do not infer dependencies from what is visibly rendered in the job page. A configuration XML element may belong to a plugin, and removing that plugin can make part of the job configuration unreadable or unavailable. Record the controller plugin baseline and compare it with the job features in use.

# Read-only plugin inventory for a disposable controller.
curl -fsS --user "$JENKINS_USER:$JENKINS_API_TOKEN"   "$JENKINS_URL/pluginManager/api/json?depth=1"   > plugins.json

# Keep only reviewed metadata in evidence; never publish credentials or secrets.

When a plugin is obsolete, do not remove it first and discover later what depended on it. Capture configuration, build representative tests in an isolated controller, migrate behavior, and only then consider removal.

7. Write a behavior contract before rewriting

Behavior to preserve Evidence from legacy job Migration acceptance test
Inputs Parameter names, defaults, validation Same supported input domain; unsafe values rejected
Scheduling Trigger type and cadence Equivalent or intentionally changed trigger documented
Execution placement Label, agent/tool assumptions New flow runs on intended trust/capability pool
Outputs Artifact patterns, report names, fingerprints Expected bytes and metadata retained
Notifications/external side effects Publisher config and provider evidence Same intended side effect, or approved replacement
Failure semantics Representative failed builds New flow fails at equivalent causal boundary

The acceptance test should compare outcomes, not XML shape. A migration can be correct even when the underlying implementation changes substantially.

8. Worked scenario: a 7-year-old release job

Assume a job has four parameters, one nightly schedule, two shell steps, artifact archiving, an email publisher, and an upload publisher. It is edited monthly and has no owner documented. The safer plan is not “convert to Jenkinsfile today.” A staged plan would:

  1. assign an owner and freeze undocumented edits;
  2. capture job config, plugin inventory, representative success/failure evidence and downstream consumers;
  3. move scripts into SCM with tests;
  4. replace or isolate the highest-risk publisher first;
  5. build a Pipeline candidate against synthetic targets;
  6. run legacy and candidate flows side-by-side on disposable outputs;
  7. cut over only after behavior and recovery are proven.

9. Rollback means preserving the old operating boundary

Rollback is more than keeping a copy of config.xml. You also need the compatible Jenkins core/Java/plugin baseline, credentials references, agent labels/toolchain, external endpoints, and any data required to interpret old build records. A migration that changes artifact format or external state may not be reversibly rolled back by restoring the old job alone.

10. Design decision checklist

Question Prefer maintain for now when… Prefer migration when…
How often does behavior change? Rarely and under controlled ownership Frequently or across many UI fields
Can changes be reviewed? Snapshots and permissions provide adequate control Lack of history is causing drift/incidents
How many plugins implement behavior? Few, healthy, well-understood dependencies Many or unhealthy/obsolete dependencies
How complex is orchestration? Single linear build with bounded side effects Multiple stages, branches, approvals, chained jobs
Can equivalence be tested? Not yet; inventory first Representative tests and synthetic targets exist
Next lesson

Diagnostics, Failure Modes, Security, and Performance

Diagnose configuration drift, destructive inputs, overlapping schedules, workspace residue, and missing plugin dependencies without erasing first-failure evidence.

Knowledge check

Does moving a job into a Jenkinsfile eliminate controller dependencies?

What should be compared during migration: XML shape or behavior?

Why is plugin removal dangerous before dependency inventory?

What is a safe intermediate migration step?

Why can chained Freestyle jobs become hard to operate?

Official references and version notes

Version and compatibility note

Rechecked on 2026-09-15. The current Jenkins LTS baseline used by this chapter is 2.568.3, tested on Java 21 and 25. Mandatory labs assume Java 21 and use only core Freestyle/parameter/timer/artifact capabilities unless your controller already requires additional dependencies. Builds must execute on a disposable agent rather than the built-in node. If a future Jenkins LTS or plugin baseline differs, revalidate behavior before copying these exact steps.

Keep the academy open

Support free, practical DevOps education.

Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.

Ethereum / ERC-20
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0Send only Ethereum/ERC-20 compatible assets to this address.