sliders_alpha
sliders_alpha

Reputation: 2454

is it possible to get the status of a previous pipeline execution on gitlab-ci?

I have a gitlab-ci.yml that does some stuff, it is scheduled to run every 4 hours. problem is the first stage is pulling an image from a repo that sometimes gets offline, the solution is to try again 30 minutes later.

how, in the gitlab-ci.yml, can I query the status of the previous pipeline execution to know if I should run or not?

(an other scheduler will be added to trigger 30 minutes after the regular execution, a variable will be set to indicate that it's the launch of a backup pipeline)

Thanks.

ps : to be clear, I want an execution of the gitlab-ci.yml to be able to check the previous execution of the gitlab-ci.yml

Upvotes: 1

Views: 3328

Answers (1)

Carmoreno
Carmoreno

Reputation: 1319

I think you are looking for CI_JOB_STATUS variable, which tells you what is the specific status of a job in your pipeline. It can be success, failed, or cancelled. You don't provide more details about your pipeline in the question, so it is a little difficult to explain how to use it in your specific pipeline.

Upvotes: 0

Related Questions