Artifact from an external job

Hi,

Goal: have an external job to add an artifact to the pipeline.

Is this possible? If so any ideas on how to achieve it?

Thanks,

You can use the REST-API. Sadly, there is no other way (afaik)

I @botkero

Thanks for your reply, but according to the Artifact’s API there’s no way to upload an artifact to a Job or Pipeline.

Oh, then I misunderstood you, I’m sorry. I thought you wanted to download artifacts from a different project.

Can you explain in more detail why you want to do this?

Is it not possible to change the order of the pipelines? So that you don’t even have to upload, but download?

So the idea is to force a step on all pipelines to execute a scan to the repo (we do manage our Gitlab free), and add an artifact with the result of the scan.

We do not want to be dependant on the development teams to add (or not) the job, so we are planing on firing the job after a git hook on push.

Unfortunately, I don’t have a direct solution for you.

I can think of 2 options, but there are more of are workarounds (and depend on your infrastructure).

  1. One pipeline collects the artifacts from all the pipelines you desire.
  2. You store the result of the artifacts in a dedicated log/file server.

Option 1 only works if you can time everything nicely. Doesn’t work if you have pipelines every 10 min.
Option 2 has the disadvantage that you need an additional resource.

Please let us know if you found a viable solution for yourself.

2 Likes