Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to display the Jenkins build status badge using Markdown.
Jenkins
[](https://jenkins.example.com/job/myproject/) Drag options to blanks, or click blank then click option'
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'.
✗ Incorrect
The correct URL for Jenkins build status badge icon is the job URL followed by '/badge/icon'.
2fill in blank
mediumComplete the Jenkins pipeline snippet to add a build status badge URL to the README file.
Jenkins
def badgeUrl = '[1]' writeFile file: 'README.md', text: ""
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect badge URL paths that do not exist.
Confusing build status badge URL with other Jenkins URLs.
✗ Incorrect
The badge URL must be the Jenkins job URL with '/badge/icon' to correctly show the build status.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'buildStatus' or 'status' which do not return badge images.
Missing the '/badge/icon' suffix.
✗ Incorrect
The correct path to get the Jenkins build status badge is '/badge/icon'.
4fill in blank
hardFill both blanks to create a Markdown badge link that points to the Jenkins job and shows the build status badge.
Jenkins
[]([2])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the badge URL as the link URL instead of the job URL.
Using invalid badge URL paths.
✗ Incorrect
The image URL is the badge icon URL, and the link URL is the Jenkins job URL.
5fill in blank
hardFill 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: "" echo 'Badge URL: [3]'
Drag options to blanks, or click blank then click option'
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.
✗ Incorrect
The badgeUrl variable holds the badge URL, which is used inside the Markdown and echoed using the variable name.