0
0
Jenkinsdevops~5 mins

Artifact retention policies in Jenkins - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is an artifact in Jenkins?
An artifact is a file or set of files produced by a Jenkins build, such as compiled code, reports, or logs, that can be saved and used later.
Click to reveal answer
beginner
Why do we need artifact retention policies in Jenkins?
To control how long build artifacts are kept, saving storage space and keeping Jenkins clean by deleting old or unnecessary files automatically.
Click to reveal answer
intermediate
How can you configure artifact retention in a Jenkins job?
By setting 'Discard old builds' in the job configuration and specifying how many builds or days to keep artifacts and builds.
Click to reveal answer
beginner
What happens if you do not set an artifact retention policy?
Artifacts and builds will be kept forever, which can use a lot of disk space and slow down Jenkins over time.
Click to reveal answer
intermediate
Can artifact retention policies be automated in Jenkins pipelines?
Yes, using pipeline scripts you can add steps to delete old artifacts or limit how many builds keep artifacts automatically.
Click to reveal answer
What is the main purpose of artifact retention policies in Jenkins?
ATo backup artifacts to cloud storage
BTo speed up the build process
CTo increase the number of builds stored
DTo save disk space by deleting old build artifacts
Where do you configure artifact retention settings in a Jenkins freestyle job?
AIn the 'Discard old builds' section of the job configuration
BIn the Jenkins global settings
CIn the build triggers section
DIn the post-build actions
What is a risk of not setting artifact retention policies?
AJenkins will delete all builds automatically
BArtifacts will be uploaded to the wrong location
CDisk space may fill up causing Jenkins to slow down or fail
DBuilds will not run
Can artifact retention be controlled in Jenkins pipelines?
ANo, only freestyle jobs support retention policies
BYes, using pipeline scripts to delete or limit artifacts
COnly by installing plugins
DOnly through Jenkins global configuration
Which of these is NOT a typical retention policy setting in Jenkins?
AMaximum artifact file size
BNumber of days to keep builds
CNumber of builds to keep
DDelete artifacts older than a certain date
Explain how artifact retention policies help maintain Jenkins performance and storage.
Think about what happens if old files are never deleted.
You got /4 concepts.
    Describe the steps to set up artifact retention in a Jenkins freestyle job.
    Look for the section that controls old build cleanup.
    You got /4 concepts.