← Back to Quiz Home
Welcome! 🤵♂️
Test your knowledge on Pipelines, Agents, and Artifacts.
Instructions:
- Select the best answer for each question.
- Your score will be shown at the end.
What are the two syntaxes for Jenkins Pipelines?
Pipelines can be written in Declarative syntax (easier, more structured) or Scripted syntax (Groovy-based, more flexible).
In a Jenkinsfile, which block contains the actual work?
Inside a stage, the steps block contains the actual commands to execute.
What is the purpose of the archiveArtifacts step?
archiveArtifacts captures files (like JARs, WARs, reports) produced by the build so they can be downloaded from the Jenkins UI.
Which cron syntax means "Run every 15 minutes"?
H/15 * * * * runs the job every 15 minutes. 'H' is used to spread load (hash).
What is a "Shared Library" in Jenkins?
Shared Libraries allow you to define common logic in external Git repositories and load them into your Pipelines.
How do you define a parameter in a Declarative Pipeline?
The parameters directive is used to define build parameters.
What does the post section in a Pipeline do?
The post section handles conditions like always, success, failure, changed to run cleanups or notifications.
Which directive is used to specify where the pipeline runs?
agent specifies the execution point. agent any runs on any available agent.
How can you safely use secrets (like passwords) in a Pipeline?
You should store secrets in Jenkins Credentials and access them using withCredentials or credentials() helper.
What is "Jenkins Configuration as Code" (JCasC)?
JCasC allows defining the configuration of the Jenkins controller in a YAML file for reproducible setups.
What is the parallel directive used for?
The parallel directive allows you to define a list of stages to run in parallel.
How do you access Environment Variables in a Pipeline?
Use ${env.VAR_NAME} or simply env.VAR_NAME to access environment variables.
Which step allows you to pause the pipeline for user approval?
The input step pauses execution until a user manually approves or aborts.
What is the when directive used for?
when allows you to control whether a stage should be run depending on criteria (e.g., branch name, environment variable).
What is a Multibranch Pipeline?
It scans the SCM repository for branches and creates a Pipeline job for each branch containing a Jenkinsfile.
How do you discard old builds automatically?
The buildDiscarder option allows you to configure log rotation (e.g., keep last 5 builds).
Which file works as an ignore list for the SCM checkout?
Jenkins respects .gitignore during the checkout process if standard Git behavior is used, effectively ignoring files from being tracked.
What is the stash step used for?
stash saves a set of files for use later in the same build, often to transfer workspace content between different agents.
How do you set a timeout for a stage?
The timeout option aborts the stage/pipeline if it takes longer than the specified time.
What is the retry option used for?
retry(3) will retry the enclosed steps up to 3 times if they fail.
Quiz Progress
0 / 0 questions answered
(0%)
0 correct
Quiz Complete!
0%
📚 Study Guides
📬 Weekly DevOps, Cloud & Gen AI quizzes & guides