'How to get the results (succeeded or failed) of previous stages/jobs in a pipeline of GitLab CI?
In one pipeline there are multiple stages. How can I get the results (succeeded or failed) of previous stages/jobs in the last stage/job of a pipeline?
Solution 1:[1]
One way is to use the gitlab-ci job api to find the status from its response;
However, depending on your use case; you can also use CI_JOB_STATUS
in the 'after_script` of the same job.
You can use a custom variable as a flag, that you can set in the after script of the same job based on CI_JOB_STATUS
.
Note: CI_JOB_STATUS
can be success
, failed
, or canceled
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Kaish kugashia |