Closed jenkins-infra-bot closed 2 years ago
It would be awesome to have similar tag for plugin-site
Hi, Can I work on this issue? This is my first issue here. I'm sure I'll be able to crack it with a little guidance.
Your welcome to take it, I don't have any jenkins-infra specific examples
As for plugin-site, since the deploy isn't dockered, it doesn't need to be done.
Hi Rajalakshmi V greetings, you have to update a Jenkinsfile in order to use github release version instead of git commit as describe here, then you open a pull request and if it's merged then the next docker image will use github release version. you can use the git tag for this as it's the same
As far as I know we don't have example
My own shared library might be a good reference - https://github.com/halkeye/jenkins-shared-library/blob/master/vars/buildDockerfile.groovy#L39-L53
Olivier Vernin, The Jenkins file mentioned in the ticket description is of the plugin-site. But in the previous comments, Gavin Mogan mentioned that changes to the plugin-site is not necessary.
The changes have to be made in this file itself, right?
https://github.com/jenkins-infra/plugin-site-api/blob/e03bcc67bcd2ea0a5068ae0cb66b4739ed38f3e3/Jenkinsfile#L73 is absolutely plugin-site-api
Hi Gavin Mogan,
Thanks for the response.
These are the things I need to do from what I understood:
Please correct if there's a miunderstanding.
Thanks
more or less. 2 is where the meat of the work is.
`rev-parse HEAD` returns the current commit hash for like the current commit
https://stackoverflow.com/questions/3404936/show-which-git-tag-you-are-on has some ideas, specifically `git tag --points-at HEAD` looks like a good idea, which returns the tag name for the current version.
I don't know if olivier was thinking of removing the per commit docker images or not, but I'd check to see if the current commit is tagged, and docker tag $imageName:$tagName, then docker push $imageName:$tagName
Gavin Mogan, tried the commands out in my local.
`git tag --points-at HEAD` returns a blank if the current commit is untagged.
However, `git describe --tags --abbrev=0` always returns the recent tag.
[This|https://pasteboard.co/J42KIbX.png] is an image of my trial.
In my opinion, we can go with the latter. Please comment on the same.
The goal is to push docker images that relate to a released tag.
If you use an older tag, then the docker image won't be on the right commit.
Tags are a point in time
If there's no tag on this commit, then don't push a docker image for a tag
Okay.
So if there exists a tag for the current commit use that else use the commit id directly, am I right?
Sounds good to me.
Hi there!
Since the issue was not updated in more than a year, I gave it a try during this year's Hacktoberfest.
Here's a PR with my humble attempt to solve it: https://github.com/jenkins-infra/plugin-site-api/pull/108
Let me know if there's anything to do differently, I'm happy to learn more
Thanks a lot for your attention, and have a great day!
Thanks for the PR Antoine Neveux
It would be nice to use Github release as Docker image tag.
This implies changing this Jenkinsfile.
Once done we'll be able to automatically deploy new versions as defined by this
Originally reported by olblak, imported from: Update jenkinsciinfra/plugin-site-api tag to use github release