gitlab-plugin icon indicating copy to clipboard operation
gitlab-plugin copied to clipboard

Add method to publish build artifacts to GitLab

Open ananace opened this issue 7 years ago • 10 comments

There's currently a lack of a method to push build artifacts from Jenkins to GitLab as resulting from the builds. On Merge Requests this can be hacked around by providing a comment with the artifact links, but for regular Push and Tag builds that method won't work.

GitLab does seem to have support for this through their API as well, though I don't know how hard it would be to do from the Jenkins side.

ananace avatar Jan 12 '17 12:01 ananace

Unfortunately the support seems to be for internal ci only. There is no upload api for consumer clients.

mreichel avatar Mar 22 '17 13:03 mreichel

@mreichel I talked to @dblessing from GitLab about this, he thinks it would be possible for us to hook into this feature of GitLab. After Jenkins builds and reports the result to GitLab, GitLab creates an internal build ID. By querying for that ID, we can then use that to attach files.

omehegan avatar Mar 24 '17 18:03 omehegan

Ok, great. I take a look on it.

mreichel avatar Mar 27 '17 08:03 mreichel

@dblessing If I understand it correctly, I get the internal build ID back, when I set the commit status (for example). But I still need to authenticate against the internal build API with the CI_BUILD_TOKEN to post the attachments (that does not work for me at the moment). Is that correct? Or is there a way to use the API token?

mreichel avatar Mar 29 '17 09:03 mreichel

@dblessing can you comment on this? Or @mreichel maybe open an issue directly with GitLab: https://gitlab.com/gitlab-org/gitlab-ce/issues/

omehegan avatar Jul 06 '17 05:07 omehegan

I opened the following issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/35183 with Gitlab Should we close the issue here?

mreichel avatar Jul 17 '17 07:07 mreichel

Let's keep this open so we have a link to the issue on the GitLab side, in case others come along looking for this feature. Thanks!

omehegan avatar Jul 17 '17 20:07 omehegan

Any Update on this feature?

asadpiz avatar Jul 12 '19 10:07 asadpiz

bump!

galek avatar Mar 14 '21 08:03 galek

Interested as well. Thanks for the investigation. Updated gitlab issue link https://gitlab.com/gitlab-org/gitlab/-/issues/18794

builder-main avatar Jul 22 '21 19:07 builder-main