Inline Pipeline versus Pipeline from SCM

Scenario: A production fix typed into the UI succeeds once but has no application review or rollback history.

Pipeline example

// Jenkinsfile stored with application source
pipeline { agent any; stages { stage('Revision') { steps { sh 'git rev-parse HEAD' } } } }

A Jenkinsfile belongs to a revision

An inline Pipeline lives in job configuration. It can bootstrap administration, but application delivery edited in a text box lacks the application's pull-request history. Pipeline from SCM points Jenkins to a repository, credential, branch specification, and script path. The Jenkinsfile is then reviewed and versioned beside the source, so a build of commit abc can use the delivery contract reviewed for abc.

Jenkins first fetches enough SCM data to load the script, then the Pipeline may perform a workspace checkout. Declarative also checks out by default unless skipDefaultCheckout is set. Avoid accidental double checkout and record the actual commit and repository URL. Pin shared-library revisions separately; otherwise an unchanged Jenkinsfile can execute new privileged library code.

Recovery is a source change

Replay is valuable for diagnosis because it reruns a past Pipeline with edited Groovy, but that program is not a reviewed application revision. Commit the proven correction and execute it normally before treating it as a production fix. Protect Jenkinsfile ownership and default branches because changing CI instructions can grant artifact publication or deployment authority.

For checkout failures separate repository authentication, ref resolution, webhook delivery, network access, workspace corruption, and missing Jenkinsfile. Preserve checkout logs and the resolved SHA. A build URL and commit should reconstruct which program ran; a successful one-off UI edit that disappears after controller recovery fails the traceability standard.

Goal: Practice the concrete behavior in jenkins-scm-trigger-recovery. Learn sections have no Jenkins terminal; the Jenkins lab opens the real shared service in a new full-screen tab inside your private folder.