Jobs API - Replay a Job without the creation of a New Job

Hi there,

I am trying to use the Jobs API to trigger a manual job in which the end point will be triggered by a scheduler outwith Gitlab every 5 minutes. I want to know if there is a way to replay a job, whereby the existing job ID is triggered rather than it generating a new job. I have so far tried both POST /projects/:id/jobs/:job_id/play and POST /projects/:id/jobs/:job_id/retry and both seem to result in a new job being generated and triggered.

I share the repo with another 5 developers so it inconveniences them to have to search through a list of jobs to find previous deploys.

Any help would be appreciated!

Cheers,

Ciaran

Hello Ciaran,
I do not think this is possible. Otherwise GirLab would need a concept of runs of a job, i.e. pipeline 123, job 2345, run 2. But there is no such concept. If you really, really need this, gocd could be an option.

Regards Mirko

HI Mirko,

thanks for your help. It would be quite a massive change for us to move over to gocd given how much we rely on gitlab currently. We might in the end just have an end point on an AWS server instead of using the gitlab pipelines.

Thanks anyway.

Cheers,

Ciaran