有什么方法可以在Jenkins中获得Gitlab管道工件? [英] Is there any way to get Gitlab pipeline artifacts in Jenkins?

查看:94
本文介绍了有什么方法可以在Jenkins中获得Gitlab管道工件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在gitlab中有一个项目.为仓库中的每个签入构建项目,并在gitlab管道成功时创建构建工件.

I have a project in gitlab. The project gets built for every check-in in the repo and build artifacts are created when the gitlab pipeline is successful.

我想在我的詹金斯管道工作中得到这些构建工件.有什么办法吗? 我在Jenkins中找不到任何插件可以做到这一点.

I want to get these build artifacts in my jenkins pipeline job. Is there any way to do that? I couldn't find any plugin in Jenkins to do this.

感谢您的帮助.

推荐答案

GitLab API 提供完整的工件包(zip)和单个文件.您需要 GitLab令牌,您可以将其添加为凭证(秘密文本)和要从其复制管线的项目编号. GanttLab Live的项目ID示例.

The GitLab API offers this with both complete artifacts package (zip) and single files. You need a GitLab token which you can add as a Credential (secret text) and the project number for the pipline you want to copy from. Project ID example of GanttLab Live.

curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/artifacts/master/download?job=test"

这篇关于有什么方法可以在Jenkins中获得Gitlab管道工件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆