问题
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