0
0
Jenkinsdevops~10 mins

Build status badges 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 display the Jenkins build status badge using Markdown.

Jenkins
[![Build Status]([1])](https://jenkins.example.com/job/myproject/)
Drag options to blanks, or click blank then click option'
Ahttps://jenkins.example.com/job/myproject/buildStatus
Bhttps://jenkins.example.com/job/myproject/badge/icon
Chttps://jenkins.example.com/job/myproject/status.png
Dhttps://jenkins.example.com/job/myproject/build/badge
Attempts:
3 left
💡 Hint
Common Mistakes
Using '/buildStatus' or '/status.png' which are not valid Jenkins badge URLs.
Forgetting to use the exact path '/badge/icon'.
2fill in blank
medium

Complete the Jenkins pipeline snippet to add a build status badge URL to the README file.

Jenkins
def badgeUrl = '[1]'
writeFile file: 'README.md', text: "![Build Status](${badgeUrl})"
Drag options to blanks, or click blank then click option'
Ahttps://jenkins.example.com/job/myproject/badge/icon
Bhttps://jenkins.example.com/job/myproject/buildStatus
Chttps://jenkins.example.com/job/myproject/status
Dhttps://jenkins.example.com/job/myproject/build/badge/icon
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect badge URL paths that do not exist.
Confusing build status badge URL with other Jenkins URLs.
3fill in blank
hard

Fix the error in this Jenkinsfile snippet to correctly generate the build status badge URL.

Jenkins
def badgeUrl = 'https://jenkins.example.com/job/myproject/[1]'
Drag options to blanks, or click blank then click option'
Astatus
BbuildStatus
Cbadge/icon
Dbuild/badge
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'buildStatus' or 'status' which do not return badge images.
Missing the '/badge/icon' suffix.
4fill in blank
hard

Fill both blanks to create a Markdown badge link that points to the Jenkins job and shows the build status badge.

Jenkins
[![Build Status]([1])]([2])
Drag options to blanks, or click blank then click option'
Ahttps://jenkins.example.com/job/myproject/badge/icon
Bhttps://jenkins.example.com/job/myproject/
Chttps://jenkins.example.com/job/myproject/buildStatus
Dhttps://jenkins.example.com/job/myproject/build/badge
Attempts:
3 left
💡 Hint
Common Mistakes
Using the badge URL as the link URL instead of the job URL.
Using invalid badge URL paths.
5fill in blank
hard

Fill all three blanks to create a Jenkins pipeline snippet that sets the badge URL, writes it to README, and echoes the badge URL.

Jenkins
def badgeUrl = '[1]'
writeFile file: 'README.md', text: "![Build Status]([2])"
echo 'Badge URL: [3]'
Drag options to blanks, or click blank then click option'
Ahttps://jenkins.example.com/job/myproject/badge/icon
BbadgeUrl
C${badgeUrl}
Dhttps://jenkins.example.com/job/myproject/buildStatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect badge URLs.
Not using variable interpolation correctly in the Markdown string.
Echoing the URL string instead of the variable.