0
0
Jenkinsdevops~5 mins

Jenkinsfile concept - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Jenkinsfile?
A Jenkinsfile is a text file that contains the definition of a Jenkins pipeline. It tells Jenkins how to build, test, and deploy your project automatically.
Click to reveal answer
intermediate
What are the two types of Jenkins pipelines you can define in a Jenkinsfile?
The two types are Declarative Pipeline and Scripted Pipeline. Declarative is simpler and structured, Scripted is more flexible and uses Groovy code.
Click to reveal answer
beginner
Where should you store the Jenkinsfile in your project?
You should store the Jenkinsfile in the root directory of your project repository. This way, Jenkins can find it easily when it checks out your code.
Click to reveal answer
beginner
How does Jenkins use the Jenkinsfile during a build?
Jenkins reads the Jenkinsfile to understand the steps to run. It executes those steps in order, like compiling code, running tests, and deploying, all automatically.
Click to reveal answer
intermediate
Why is using a Jenkinsfile better than configuring jobs manually in Jenkins UI?
Using a Jenkinsfile keeps your pipeline as code, which means it is version controlled, easy to review, share, and reproduce. Manual UI setup is error-prone and hard to track.
Click to reveal answer
What file name does Jenkins look for by default to define a pipeline?
ADockerfile
Bpipeline.txt
Cbuild.gradle
DJenkinsfile
Which language is primarily used inside a Jenkinsfile for scripted pipelines?
AGroovy
BRuby
CJavaScript
DPython
Where is the best place to store your Jenkinsfile?
AIn the root of your project repository
BOn a separate server
CIn Jenkins server configuration
DIn a cloud storage bucket
What is a key benefit of using a Jenkinsfile over manual job configuration?
AIt runs faster
BIt requires no coding knowledge
CIt allows pipeline as code with version control
DIt uses less memory
Which pipeline type in Jenkinsfile is simpler and uses a structured syntax?
AScripted Pipeline
BDeclarative Pipeline
CManual Pipeline
DAutomated Pipeline
Explain what a Jenkinsfile is and why it is important in Jenkins automation.
Think about how Jenkins knows what steps to run automatically.
You got /3 concepts.
    Describe the difference between Declarative and Scripted pipelines in a Jenkinsfile.
    One is simpler and more readable, the other is more flexible.
    You got /3 concepts.