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 parameter is a value the person (or script) starting the build chooses at that moment: which branch to build, which environment to deploy to, whether to run the slow tests. In a Freestyle job you add them through "This project is parameterized" (see Jenkins build parameters). In a pipeline you declare them in code, in a parameters block, so they are versioned with the Jenkinsfile.
pipeline {
agent any
parameters {
string(name: 'BRANCH', defaultValue: 'main', description: 'Git branch to build')
booleanParam(name: 'RUN_E2E', defaultValue: false, description: 'Run the slow browser tests?')
choice(name: 'TARGET', choices: ['qa', 'staging', 'prod'], description: 'Where to deploy')
}
stages {
stage('Checkout') {
steps {
git branch: params.BRANCH, url: 'https://github.com/example/student-portal.git'
}
}
stage('Unit tests') {
steps { sh 'npm ci && npm test' }
}
stage('E2E tests') {
when { expression { params.RUN_E2E } }
steps { sh 'npx playwright test' }
}
stage('Deploy') {
steps {
echo "Deploying ${params.BRANCH} to ${params.TARGET}"
sh './deploy.sh "$TARGET"'
}
}
}
}
text is the multi-line version.params.RUN_E2E is a real boolean, so it works directly in when { expression { ... } }.Read values with params.NAME in Groovy. Jenkins also exposes each parameter as an environment variable, so the shell can use $TARGET.
main, an unticked checkbox "RUN_E2E", and a drop-down "TARGET" showing qa. Each field shows its description underneath.# from another pipeline
build job: 'student-portal', parameters: [
string(name: 'BRANCH', value: 'release/2.1'),
booleanParam(name: 'RUN_E2E', value: true),
string(name: 'TARGET', value: 'staging')
]
# from a script, with a user's API token
curl -X POST -u ci-bot:API_TOKEN \
"https://jenkins.example.com/job/student-portal/buildWithParameters?TARGET=qa&RUN_E2E=true"
More ways to trigger jobs are in triggering Jenkins jobs.
parameters block only when the Jenkinsfile runs, so build #1 runs with defaults and only then does "Build with Parameters" appear. The same happens after you add or rename a parameter: one run updates the form.if (env.RUN_E2E) is always true. As an environment variable the value is the string 'false', which Groovy treats as true. Use params.RUN_E2E, which is a boolean.${params.TARGET}. You used single quotes in a Groovy string. Use double quotes for Groovy interpolation, or single quotes with $TARGET inside sh."$TARGET"), prefer choice for anything that picks a server, and never use parameters for passwords; use Jenkins credentials (see pipeline variables).Need a human to confirm a value in the middle of a run instead of at the start? Use the input step.
Hands-on live training, real projects and Dedicated Placement Support — become job-ready in DevOps.
Enroll in DevOps Training →