'Gitlab: use pipeline artifaces in other pipeline

I'm migrating form Jenkins to Gitlab CI (self-hosted) and try to setup a workflow for all projects. One project is a Golang tool whose binary is required in other projects. I've setup a working pipeline for the Golang project which builds a release with an attached binary for download. How can I reuse that binary in other project pipelines? Is there a way to download the binary with the REST API of Gitlab, or can I reuse the artifact of the release job in the other pipelines? I've searched the documentation of Gitlab and did not find an elegant solution for this yet :-/



Solution 1:[1]

I've found a solution now. It's possible to use curl to download the build artifact for reuse

curl -L --header "PRIVATE-TOKEN: <TOKEN>" "https://<HOSTNAME>/api/v4/projects/<PROJECT_ID>/jobs/artifacts/master/raw/<ARTIFACT_PATH>?job=build" --output <BINARY_NAME>

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 Axel Steiner