[Solved] Start/end time for a build in status badges

Hi,
In our company we are currently migrating from Jenkins to gitlab.
In Jenkins based projects we have build status formatting feature so we could see last build time (build start time, actually).
Which allows us to format status message in X days YY hours ago| passing (see screenshot attached)

Here how badge [Jenkins] request looks in our README.md:

Latest `dev` build: [![Build Status](https://jenkins.example.com:8443/buildStatus/icon?job=BX%2Fproject-proxy%2Fdev&subject=${startTime}%20ago)](https://jenkins.example.com:8443/job/BX/job/project-proxy/job/dev/)

Since our team has quite a few projects we switch from time to time, having that status time and status in front of eyes gives a quick overview from ci/cd perspective when we switch between the projects.

Wonder if someone from community implemented something similar with gitlab?

image

Regards,
Alex

1 Like

Hi @myxit,

Yay for moving projects to GitLab :tada: and thank you for your question!

GitLab has Pipeline and Test Coverage badges. by default. Based on what you described, it sounds like you’re looking for something more dynamic.

You might be able to find that status time information in the job artifacts by URL, by building on an existing project like badges-gitlab or through a service like shields.io.

It does sound like a cool use case, so do share a solution or community projects you find helpful! :smile:

2 Likes

Hi @sugaroverflow
Thank you for quick reply and example provided.
Looks exactly I wanted.

Regards,
Alex

2 Likes