I have a pipeline running externally and send the status of the pipeline back to GitLab through GitLab API. I am wondering if it is also possible to send the pipeline logs and store them in the job artifact of GitLab. From what I understand, the artifact seems to be created only via internal (gitlab-ci.yml) and documentation here does not state any option to create POST to the job artifact as well.
Asked
Active
Viewed 191 times
0
-
Generally speaking, it's possible to automate almost anything, so long as it is computable. There may be restrictions, of course, such as security requirements, disk space and other considerations. – Robert Harvey Oct 05 '21 at 21:23
-
@RobertHarvey Do you perhaps know any related documentation or example that could achieve such a thing? – Jane Oct 05 '21 at 21:27
-
Do you have some code you've already written that we could look at? Where did you get stuck? – Robert Harvey Oct 05 '21 at 21:28
-
@RobertHarvey Not exactly stuck. I successfully send the status to GitLab pipeline via GitLab API [link](https://docs.gitlab.com/ee/api/commits.html#:~:text=Post%20the%20build%20status%20to%20a%20commit) but I could not see any option where I can send the log file as an artifact. – Jane Oct 05 '21 at 21:32
-
To what end? ... – Robert Harvey Oct 05 '21 at 21:36
-
So I sent the pipeline status back to GitLab via this `POST /projects/:id/statuses/:sha` and in GitLab, it appears as an external job (doesn't even have job id). – Jane Oct 05 '21 at 21:41
-
https://xyproblem.info/ – Robert Harvey Oct 05 '21 at 21:42
-
What I am looking into right now is this [docs](https://docs.gitlab.com/ee/api/job_artifacts.html#) which states only how to `GET` the artifact from the pipeline and it requires `job_id` (which I don't have bc of the external job). While what I am trying to do is to send file to the pipeline artifact. – Jane Oct 05 '21 at 21:52