-
Notifications
You must be signed in to change notification settings - Fork 313
chore: improve registry-scanner/hack/create-release.sh #1157
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
chore: improve registry-scanner/hack/create-release.sh #1157
Conversation
…o annotated tags, automatically pushing updated VERSION file, and adding some examples Signed-off-by: Christopher Coco <[email protected]>
823714e to
c8d07ef
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1157 +/- ##
=======================================
Coverage 63.34% 63.34%
=======================================
Files 15 15
Lines 2357 2357
=======================================
Hits 1493 1493
Misses 769 769
Partials 95 95 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
registry-scanner/VERSION
Outdated
| @@ -1 +1 @@ | |||
| 0.111.0 | |||
| 0.1.0 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intentionally kept an unreal value. The real value is set in a release-* branch. See
https://github.com/argoproj-labs/argocd-image-updater/blob/release-0.16/VERSION
https://github.com/argoproj-labs/argocd-image-updater/blob/registry-scanner/release-0.1/registry-scanner/VERSION
| # `./hack/create-release.sh 0.1.X "TEST"` origin Would create a new tag "registry-scanner/v0.1.X" with | ||
| # the message "TEST" and edit VERSION to be 0.1.X which | ||
| # would be committed. The contents would be pushed to the | ||
| # remote "origin." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a message gives more control for users to custom a tag and commit message, but at the same time also makes it slightly harder to run this command. I think the tag and commit message are pretty standard, using the tag name should suffice.
| #if [[ ! "${CURRENT_BRANCH}" == registry-scanner/release-* ]]; then | ||
| # echo "!! Please checkout branch 'registry-scanner/release-X.Y' (currently in branch: '${CURRENT_BRANCH}')" >&2 | ||
| # exit 1 | ||
| #fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the above validation is useful and should be preserved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops forgot to uncomment when I was testing 😅
|
|
||
| # Commit updated VERSION file | ||
| git add VERSION | ||
| git commit -s -m "automated: bump VERSION file to version ${TARGET_VERSION}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use the conventional commit message: "Release ${NEW_TAG}"
| # Create tag for registry-scanner | ||
| git tag "${NEW_TAG}" | ||
| git push "${REMOTE}" tag "${NEW_TAG}" | ||
| git tag -a "${NEW_TAG}" -m "${MESSAGE}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
message can be the same as ${NEW_TAG}
| git tag "${NEW_TAG}" | ||
| git push "${REMOTE}" tag "${NEW_TAG}" | ||
| git tag -a "${NEW_TAG}" -m "${MESSAGE}" | ||
| git push "${REMOTE}" --follow-tags #tag "${NEW_TAG}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the trailing comment seems redundant.
since we're usually directly pushing to upstream, I'd like to be specific about which tags and branches, something like:
git push "${REMOTE}" ${RELEASE_BRANCH} ${NEW_TAG}
Will that achieve the same effect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That flag prevents you from needing to do a git push for the VERSION file commit and then needing to do another git push to commit the tag. It can be split up no problem but I left the comment as a note of what was originally was there. Which would be preferred the two separate pushes or just the one?
…t branch check, seperate push of commit and tag, and update tag message Signed-off-by: Christopher Coco <[email protected]>
7081583 to
a16276e
Compare
…-release.sh Signed-off-by: Christopher Coco <[email protected]>
Signed-off-by: Christopher Coco <[email protected]>
…#1157) Signed-off-by: Christopher Coco <[email protected]>
Overview
The following PR improves the registry-scanner/hack/create-release.sh with the following:
VERSIONfile in addition to the new tag to remoteI also noticed that the
VERSIONfile's contents was0.111.0. Not sure if this was intentional because the tag listed is0.1.0. I changed the file to match the tag. If it should stay0.111.0, I can revert the change.Testing:
The below screenshots show the testing that I did to validate that my changes functioned properly.
The output of

git tag -n registry-scanner/*after running./hack/create-release.sh TEST HelloHelloand./hack/create-release.sh TEST2 HelloHello2:The commits and tags in the remote after running those two commands above:


The error messages output if you are missing either the

TARGET_VERSIONorMESSAGEarguments: