Skip to content

Commit

Permalink
Fix Set image tag for release branches and tags
Browse files Browse the repository at this point in the history
Signed-off-by: 7h3-3mp7y-m4n <[email protected]>
  • Loading branch information
7h3-3mp7y-m4n committed Jun 8, 2024
1 parent 9cd9977 commit a142955
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ or if using existing repository, verify your intended remote is set to
`git push origin release-0.x` to create it
- If creating a new patch release, use existing branch `release-0.x`:
`git checkout origin/release-0.x`

- Before creating the release tag, update the image tag in the manifests to match the release version. Run the following command, replacing `<RELEASE_TAG>` with the appropriate tag.
```bash
make set-manifest-image-bmo TAG=<RELEASE_TAG>
```
### Tags

First we create a primary release tag, that triggers release note creation and
Expand Down
29 changes: 29 additions & 0 deletions hack/verify-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,34 @@ _version_check()
[[ "${min_version}" == $(echo -e "${min_version}\n${version}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) ]]
}

check_image_tag() {
if [ -z "$1" ]; then
echo "Error: No image tag provided"
exit 1
fi
TAG=$1
MANIFEST_FILES=$(find template -type f -name '*.yaml')
ERROR=0

echo "Checking the image tag :TAG"

for FILE in $MANIFEST_FILES; do
if ! grep -q "image: .*/baremetal-operator:$TAG" "$FILE"; then
echo "Error: Image tag in $FILE is not set to $TAG"
ERROR=1
fi
done

if [ $ERROR -ne 0 ]; then
echo "Image tag verification failed!"
exit 1
else
echo "Image tag verification passed."
fi

echo -e "Done\n"
}

check_tools()
{
# check that all tools are present, and pass version check too
Expand Down Expand Up @@ -677,6 +705,7 @@ check_tools
detect_remote
check_input
check_tag
check_image_tag

# post-tag verifications
if [[ -n "${TAG_EXISTS}" ]]; then
Expand Down

0 comments on commit a142955

Please sign in to comment.