gitlab:在其他管道中使用管道人工

发布于 2025-01-29 23:09:28 字数 244 浏览 4 评论 0原文

我正在将詹金斯(Jenkins)迁移到gitlab ci(自我托管),并尝试为所有项目设置工作流程。一个项目是Golang工具,其在其他项目中需要二进制。 我已经为Golang Project设置了一个工作管道,该项目可以使用附加的二进制文件构建版本。如何在其他项目管道中重复使用该二进制文件?有没有一种方法可以使用GitLab的REST API下载二进制文件,还是可以在其他管道中重新使用发行作业的工件?我已经搜索了Gitlab的文档,但还没有找到优雅的解决方案: - /

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 :-/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千纸鹤 2025-02-05 23:09:28

我现在找到了一个解决方案。可以使用卷发下载构建工件以重复使用

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

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文