Checkpoint Lab — Freestyle Projects, Build Steps, Post-Build Actions, Parameters, Triggers, and Legacy Job Maintenance
Build, verify, evidence, and plan the migration of a disposable parameterized Freestyle job while preserving causes, agent identity, artifacts, configuration, and rollback assumptions.
Learning objectives
- Construct a bounded parameterized Freestyle job on a disposable agent and archive one verifiable artifact.
- Prove distinct manual and timer build causes without leaving a recurring schedule enabled.
- Capture a sanitized evidence packet containing configuration, run identity, execution context, artifact digest, and plugin baseline.
- Write a behavior-preserving migration plan toward Pipeline without pretending controller dependencies disappear.
- Clean up only the exact disposable resources created by the checkpoint.
1. Checkpoint mission
Create a disposable Freestyle project named
legacy-release-demo that accepts bounded parameters,
runs on the linux agent pool, produces one evidence
artifact, archives and fingerprints it, runs once manually and once
from a temporary timer, and leaves enough evidence to design a
controlled migration.
2. Baseline and preflight
Jenkins 2.568.3 LTS; Java 21/25 supported; lab examples assume Java 21 on the controller and a disposable agent labeled linux.
- Disposable/local controller only.
- Built-in node executor count is 0.
- An online agent carries label
linux. - No production SCM, registry, cloud, or deployment target is used.
- No real credentials are embedded in parameters, scripts, logs, or artifacts.
Capture the controller version header, agent identity, and plugin inventory before beginning. If your controller differs from the chapter baseline, record the difference explicitly.
3. Predict state changes before touching Jenkins
Write down at least these predictions:
- Saving the job will create durable controller-side item configuration but no build record yet.
-
Triggering the job will create a queue item and then a numbered
build assigned to an eligible
linuxagent. - The shell step will create files only in that build workspace; the archive action will copy selected bytes into the Jenkins build record.
- Enabling the timer changes job configuration; disabling it later should stop future periodic causes without deleting existing build history.
You will verify each prediction independently.
4. Configure the job
Create legacy-release-demo as a Freestyle project with:
-
string parameter
RELEASE_LABEL, defaultdemo-001; -
choice parameter
CHANNELwithdevandtestonly; -
string parameter
SOURCE_SHA, default2222222222222222222222222222222222222222; - agent label restriction
linux; - one shell build step;
-
one post-build action: Archive the artifacts for
out/*, with fingerprinting enabled where available.
set -eu
case "$CHANNEL" in
dev|test) ;;
*) echo "Unsupported CHANNEL" >&2; exit 2 ;;
esac
case "$RELEASE_LABEL" in
*[!A-Za-z0-9._-]*|'') echo "Invalid RELEASE_LABEL" >&2; exit 2 ;;
esac
rm -rf out
mkdir -p out
printf 'job=%s\nbuild=%s\nchannel=%s\nsource_sha=%s\nrelease_label=%s\nnode=%s\n' "$JOB_NAME" "$BUILD_NUMBER" "$CHANNEL" "$SOURCE_SHA" "$RELEASE_LABEL" "$NODE_NAME" > out/release-evidence.txt
sha256sum out/release-evidence.txt > out/release-evidence.sha256
The label validation is intentionally conservative. The lab does not
use RELEASE_LABEL as a path, shell fragment, package
version, or external deployment selector.
5. Run and verify the manual build
Start a parameterized build with
RELEASE_LABEL=demo-manual, CHANNEL=dev,
and the synthetic SHA. Preserve:
- job full name;
- build number, URL, result and manual cause;
- parameter values;
- queue/build timing;
- agent/node name and workspace;
- console output;
- artifact names and SHA-256 digest;
- controller and plugin baseline.
Then remove the local workspace out/ directory only
after the build has completed, and verify the archived artifact
remains downloadable from the build record. This proves the archive
is retained evidence separate from the workspace copy.
6. Produce one timer-caused build
Temporarily enable Build periodically with
H/5 * * * *. Wait for one timer run, preserve its cause
and build identity, then disable the schedule immediately. The goal
is a second cause, not a permanently recurring task.
If your lab constraints do not allow waiting for the timer, document that limitation and use a second manually triggered build only as a simulation; do not falsely label it as timer evidence.
7. Capture a sanitized configuration packet
Fetch the job configuration read-only with a synthetic API-token account and save it only inside the lab evidence directory:
mkdir -p evidence
curl -fsS --user "$JENKINS_USER:$JENKINS_API_TOKEN" "$JENKINS_URL/job/legacy-release-demo/config.xml" > evidence/legacy-release-demo.config.xml
curl -fsS --user "$JENKINS_USER:$JENKINS_API_TOKEN" "$JENKINS_URL/job/legacy-release-demo/api/json?tree=name,url,builds[number,result,url,actions[causes[*]],actions[parameters[name,value]]]&depth=1" > evidence/legacy-release-demo.builds.json
Review the files before sharing them. Remove tokens or sensitive provider data if any plugin unexpectedly contributes it. The token itself must never be written into the evidence files.
8. Draft the migration plan
| Legacy behavior | Pipeline-oriented target | Migration risk to prove |
|---|---|---|
| Freestyle parameters |
Declarative parameters or controlled input
contract
|
Defaults/validation remain equivalent |
Agent label linux |
Pipeline agent label | Same trust/capability pool |
| Shell body in UI | Versioned script invoked by Pipeline | No hidden logic lost during extraction |
| Timer trigger | Versioned cron trigger if still required |
Cadence and concurrency are intentional |
| Archive post-build action |
archiveArtifacts in post or
explicit stage
|
Exact produced bytes and retention expectations match |
| UI configuration | Jenkinsfile + documented controller prerequisites | Plugin/credential/agent dependencies remain explicit |
Also identify every plugin used by the actual legacy job you are modeling. The checkpoint lab itself deliberately uses only core features so the dependency list stays small.
9. Migration acceptance criteria
- Same supported parameter domain and rejection behavior.
- Same or intentionally changed trigger behavior.
- Runs on the intended non-controller agent pool.
- Produces semantically equivalent evidence bytes from the same synthetic source identity.
- Archives the intended artifact and preserves an auditable digest.
- No real credentials are introduced into repository code, parameters, or logs.
- Rollback is defined before cutover.
10. Required evidence packet
| Evidence | Minimum content |
|---|---|
| Controller baseline | Jenkins core/LTS, Java runtime, relevant plugin list |
| Job identity | Full item name, configuration snapshot, owner/assumption note |
| Run identity | Manual and timer build number/URL/cause/result |
| Execution context | Agent, label, executor/workspace observation, tool assumptions |
| Inputs | Non-secret parameter names and values used |
| Outputs | Archived file names, SHA-256 digest, build that produced them |
| Migration | Behavior contract, plugin risks, rollback path, unresolved limitations |
11. Cleanup and rollback
- Verify the timer is disabled.
- Preserve the reviewed evidence packet outside the ephemeral workspace.
-
Delete the lab job only if you have confirmed its exact full name
is
legacy-release-demoand it was created for this checkpoint. - Remove disposable lab workspaces/agent resources created solely for the exercise.
- Do not remove plugins as cleanup; plugin governance requires separate dependency analysis.
12. What this chapter adds to the Jenkins operating model
You can now read a Freestyle job as an operational system: controller-stored configuration creates a queueable item; causes and parameters define run context; an agent/workspace executes steps; publishers retain or forward evidence; plugins extend behavior; and build history must be correlated with configuration and external state. That skill is essential before the next chapter adds real SCM checkout, Git credentials, polling, webhooks, and multi-repository source identity.
Knowledge check
After the job is saved but before it is triggered, what durable state should exist?
The controller-side item/job configuration exists, but there should be no new build record from this checkpoint yet.
Why verify archived evidence after deleting the workspace copy?
To prove the retained artifact belongs to the build record and is not merely a file left in the agent workspace.
If you cannot observe a real timer-caused run, may you label a manual run as timer evidence?
No. Record the limitation and call the substitute a simulation.
What is the migration target for the inline shell body?
Prefer a reviewed versioned script invoked by Pipeline, so orchestration and implementation changes can be audited.
What should cleanup never do casually?
Remove plugins or delete ambiguously named jobs/resources. Cleanup must target only exact disposable resources created by the lab.
Official references and version notes
- Jenkins LTS changelog — current LTS release and tested Java configurations.
- Working with projects — current project/job types, including Freestyle.
- Controller Isolation — why routine builds should execute on agents instead of the built-in node.
- Handling Environment Variables — security implications of build parameters and environment values.
- Remote Access API — build triggering and read-only evidence retrieval.
- Pipeline — first-class Jenkins model for versioned delivery workflows and the migration target used in this chapter.
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.
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0Send only Ethereum/ERC-20 compatible assets to this
address.