Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docker CI: push vX.Y tag (without patch) to DockerHub #2507

Merged
merged 2 commits into from Jun 15, 2022

Conversation

janithpet
Copy link
Contributor

@janithpet janithpet commented Jun 11, 2022

…ion.

Added a line that conditionally adds a version number without the patch version (i.e, v<major>.<minor>) if the version given by the git tag ends with .0.

Pull Request

What does this PR do?

Fixes #2497

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

@janithpet
Copy link
Contributor Author

Hello,

This is my first time contributing to a large project like this!

I hope I had understood the requirments described in #2497 correctly. I would grateful for any feedback regarding this.

Thanks!

@curquiza curquiza self-requested a review June 13, 2022 08:10
@curquiza
Copy link
Member

Hello @janithpet thanks a lot for your contribution, I'll try to review this asap! 😄

Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for the PR. If I'm correct it will not work in the case of the tag does not finish by 0.

@@ -37,6 +37,7 @@ jobs:
flavor: latest=false
tags: |
type=ref,event=tag
type=semver,pattern=v{{major}}.{{minor}},enable=${{ endsWith(github.ref_name, '.0') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand, it will not work if I publish a tag name v0.27.2 because it does not end with .0
Could it be possible to create (maybe with a regexp?) this shorter Docker tag if the git tag finishes by . and a number? In the best case, this number could be multiple digits, like v0.27.2, but also v0.27.12

Copy link
Contributor Author

@janithpet janithpet Jun 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right! I had misunderstood the requirements (sorry) -> I thought that it would only be needed if the patch ended with a .0.

I have made a new commit that adds an additional workflow step that runs regex matching. It had to be done this way because, (as far as I understand), we can't run pattern matching in an expression.

The pattern I'm matching to is v<numbers>.<numbers>.<numbers>, so that it doesn't catch tags that could look like v0.26.1-cloud-team.1, which still end with .<number>.

I tested these against a dummy repo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your reactivity! And the explanations!

@curquiza curquiza changed the title Create a docker tag without patch version if git tag has 0 patch vers… Improve docker CI: push vX.Y tag (without patch) to DockerHub Jun 14, 2022
@curquiza curquiza added maintenance Issue about maintenance (CI, tests, refacto...) tooling Not directly project related, like Docker, Homebrew... and removed maintenance Issue about maintenance (CI, tests, refacto...) labels Jun 14, 2022
@curquiza curquiza added this to the v0.29.0 milestone Jun 15, 2022
@curquiza curquiza changed the base branch from main to tmp-new-docker-tags June 15, 2022 08:43
@curquiza
Copy link
Member

Thanks a lot @janithpet for this PR! 😄
I'll merge it in my temporary branch so that I can do tests and then I will merge my branch on main. Be sure you will be in the release changelogs anyway! Thank you very much! ❤️

@curquiza curquiza merged commit b95c4b6 into meilisearch:tmp-new-docker-tags Jun 15, 2022
@janithpet
Copy link
Contributor Author

Thanks a lot @janithpet for this PR! 😄

I'll merge it in my temporary branch so that I can do tests and then I will merge my branch on main. Be sure you will be in the release changelogs anyway! Thank you very much! ❤️

No problem at all! Please let me know if any issues come up 😃

curquiza pushed a commit that referenced this pull request Jun 16, 2022
* Create a docker tag without patch version if git tag has 0 patch version.

* Create Docker tag without patch number if git tag follows v<number>.<number>.<number>
curquiza pushed a commit that referenced this pull request Jun 16, 2022
* Create a docker tag without patch version if git tag has 0 patch version.

* Create Docker tag without patch number if git tag follows v<number>.<number>.<number>

Add minor changes on CI
bors bot added a commit that referenced this pull request Jun 16, 2022
2521: Improve docker CI: push `vX.Y` tag (without patch) to DockerHub (#2507) r=curquiza a=curquiza

Following #2507

Fixes #2497 

Co-authored-by: Janith Petangoda <22471198+janithpet@users.noreply.github.com>
bors bot added a commit that referenced this pull request Jun 16, 2022
2521: Improve docker CI: push `vX.Y` tag (without patch) to DockerHub (#2507) r=curquiza a=curquiza

Following #2507

Fixes #2497 

Co-authored-by: Janith Petangoda <22471198+janithpet@users.noreply.github.com>
curquiza pushed a commit that referenced this pull request Jun 16, 2022
* Create a docker tag without patch version if git tag has 0 patch version.

* Create Docker tag without patch number if git tag follows v<number>.<number>.<number>

Add minor changes on CI
@curquiza curquiza modified the milestones: v0.29.0, v0.28.0 Aug 23, 2022
@curquiza curquiza added the v0.28.0 PRs/issues solved in v0.28.0 label Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Not directly project related, like Docker, Homebrew... v0.28.0 PRs/issues solved in v0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish docker image tag without the patch version
2 participants