Interview Prep
Interview questions, roadmaps and practice sets
Tutorials
Free tutorials on 30+ topics
Blog
Career guides, skills and interview tips
Free PDFs
Notes, cheat sheets and question banks
Certificates
Free skill tests and course certificates
Tools & Whiteboard
Free tools you can use right in the browser
Practice Tests
Mock tests, MCQs and quick Q&A
Free LMS
Learn on the Uncodemy LMS
Choose the best training program according to your career.
Improve the performance of your business with our innovative Industrial Training Program.
Read More →
Our instructor-led training classes are designed to make you an expert.
Read More →
Real-life case studies are a great way to demonstrate your practical knowledge.
Read More →
Explore blogs, latest technologies and industry updates with practical examples.
Read More →Browse all available training programs and choose the right one for your career.
Read More →Know more about who we are and what we stand for.
Discover our mission to equip individuals with essential IT skills and industry expertise.
Read More →
Free tutorials, interview questions, tools and calculators to help you learn.
Explore →Learn, practice and plan your career — bilkul free.
Book a free video counselling session and pick the right course for you.
Read More →A Jenkins Pipeline is a build process written as code. Instead of clicking options into a job's configuration page, you describe the steps (check out, build, test, deploy) in a Groovy-based script, and Jenkins runs them in order, shows each stage on screen, and stops at the first failure. Because the script can live in your repository as a Jenkinsfile, the build is versioned and reviewed like the rest of the code.
Older notes list "three types of pipeline". Strictly, Freestyle is a different job type, and a Pipeline job can be written in two syntaxes:
| Freestyle job | Scripted pipeline | Declarative pipeline | |
|---|---|---|---|
| Defined in | The web UI | Groovy code | Groovy code with a fixed structure |
| Starts with | n/a | node { ... } | pipeline { ... } |
| Stored in Git | No (config lives on the server) | Yes, as a Jenkinsfile | Yes, as a Jenkinsfile |
| Syntax checks before running | n/a | Few | Yes, structure is validated first |
| Typical use | Very simple or legacy jobs | Complex logic, loops, shared libraries | Most new pipelines |
Start with declarative. When you need full Groovy logic, you can still drop into a script { } block inside a declarative stage.
pipeline {
agent any // where to run: any free agent
options {
timeout(time: 30, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr: '20'))
}
stages {
stage('Checkout') {
steps { checkout scm }
}
stage('Build') {
steps { sh 'npm ci' }
}
stage('Test') {
steps { sh 'npm test' }
}
stage('Deploy to QA') {
when { branch 'main' } // only on the main branch (multibranch jobs)
steps { sh './deploy.sh qa' }
}
}
post {
failure { echo "Build ${env.BUILD_NUMBER} failed" }
always { cleanWs() } // needs the Workspace Cleanup plugin
}
}
agent any, agent { label 'linux' }, or agent none with an agent per stage.sh, bat, echo, checkout.always, success, failure...). See post-build actions.The same build in scripted syntax would start with node { stage('Build') { sh 'npm ci' } }: shorter for tiny jobs, but with no built-in structure or validation.
Jenkinsfile.The Pipeline Syntax link on the job page opens the snippet generator, which writes the code for any step you choose from a form. It is the quickest way to get the exact syntax for a plugin step.
WorkflowScript: ... Expected a step or Expected a stage: a block is in the wrong place, for example a command directly inside stage without steps.No such DSL method 'xyz': a typo, or the plugin that provides the step is not installed.script returned exit code 1: the shell command failed. The real error is in the lines just above in the console log.Scripts not permitted to use method ...: the Groovy sandbox blocked a call. An administrator must approve it under Manage Jenkins → In-process Script Approval, or you rewrite the code without it.bat or powershell instead of sh.To try changes without committing, open a finished build and use Replay, which lets you edit the Jenkinsfile for one run. For a CI example with browser tests, see integrating Playwright with CI/CD tools.
Hands-on live training, real projects and Dedicated Placement Support — become job-ready in DevOps.
Enroll in DevOps Training →