Gitlab Api requests

,

There is a gitlab-based project which uses CI/CD procedures. I have several questions about gitlab api usage:

  1. How can I get the number of pipelines, which were produced by those who use the project?
  2. There is a script on ‘build’ stage of the .yaml file. How can I count how many times was the script activated?
  3. How can I count, how many releases were deployed?

Stages of gitlab-ci.yaml file look like these:

stages:

  • Preprocessing
  • UnitTest
  • UploadResults
  • Build
  • Publish
  • Release

Will be grateful for pointing where I can find suitable requests in gitlab api docs

I think most of the answers for your questions are already in gitlab docs. Try referring it again.

Hi,

By pipelines, you likely mean the number of runs of a pipeline including all jobs in there, right?

Can you please share the content of your .gitlab-ci.yml file? Depending on the script you have put in there, you may add your own counting logic with a temporary file holding a number and then incrementing it.

That would need the detail on how release deployments are triggered. I’d assume you are tagging a release in git with having the CI config being set to only: tags and triggering the deployment process. By the number of releases you can see the deployments then.

If you are deploying on each git commit, and even allow manual deployments, a different counting mechanism is needed. In order to fully understand your development and deployment workflow, please share the .gitlab-ci.yml file and corresponding scripts. We then may suggest some more details - CI/CD monitoring and reporting can be found in the menu already if you haven’t seen that.

Cheers,
Michael

2 Likes

By pipelines, you likely mean the number of runs of a pipeline including all jobs in there, right? - exactly. As I see, this can be found with GET /projects/:id/pipelines - right?