0
0
Jenkinsdevops~10 mins

Stash and unstash for passing data in Jenkins - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to stash files named 'build.log'.

Jenkins
stash name: 'logs', includes: '[1]'
Drag options to blanks, or click blank then click option'
A*.txt
Bbuild.log
C*.xml
Doutput.log
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong filename pattern like '*.txt' or '*.xml'.
2fill in blank
medium

Complete the code to unstash the files named 'logs'.

Jenkins
unstash '[1]'
Drag options to blanks, or click blank then click option'
Aoutput
Bbuild
Clogs
Darchive
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different stash name than the one used in stash.
3fill in blank
hard

Fix the error in the stash command to correctly stash all '.jar' files.

Jenkins
stash name: 'artifacts', includes: '[1]'
Drag options to blanks, or click blank then click option'
A*.tar
Bjar
C*.zip
D*.jar
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'jar' without wildcard does not match files.
4fill in blank
hard

Fill both blanks to stash all '.txt' files and unstash them later.

Jenkins
stash name: '[1]', includes: '*.txt'
...
unstash '[2]'
Drag options to blanks, or click blank then click option'
Atextfiles
Blogs
Dartifacts
Attempts:
3 left
💡 Hint
Common Mistakes
Using different names for stash and unstash causes errors.
5fill in blank
hard

Fill all three blanks to stash '.log' files, unstash them, and then archive the logs.

Jenkins
stash name: '[1]', includes: '*.log'
...
unstash '[2]'
archiveArtifacts artifacts: '*.log', fingerprint: true, allowEmptyArchive: [3]
Drag options to blanks, or click blank then click option'
Alogfiles
Cfalse
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Mismatched stash names or setting allowEmptyArchive to false causing errors.