Is there any way to get Gitlab pipeline artifacts in Jenkins?

早过忘川 提交于 2020-12-12 02:04:54

问题


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.

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.

Any help is appreciated.


回答1:


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"


来源:https://stackoverflow.com/questions/49767736/is-there-any-way-to-get-gitlab-pipeline-artifacts-in-jenkins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!