Skip to content

Commit

Permalink
Use the product version in dockerfile and charts.yaml
Browse files Browse the repository at this point in the history
The product version needs to be used for the Dockerfile reference label.
Keep the tito version in the version label as tito looks for it.
  • Loading branch information
cbosdo committed Jan 11, 2024
1 parent 0e6e313 commit d2d2241
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/push-packages-to-obs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ while read PKG_NAME; do
# SUSE Manager settings
VERSION=$(sed 's/^\([0-9]\+\.[0-9]\+\).*$/\1/' ${GIT_DIR}/rel-eng/packages/uyuni-base)
sed "/^#\!BuildTag:/s/uyuni/suse\/manager\/${VERSION}/g" -i $SRPM_PKG_DIR/Dockerfile
sed "s/^\(LABEL org.opensuse.reference=\)\"\([^:]\+:\)\([^%]\+\)%RELEASE%\"/\1\"\2${PRODUCT_VERSION}.%RELEASE%\"/" -i $SRPM_PKG_DIR/Dockerfile
sed "/^# labelprefix=/s/org\.opensuse\.uyuni/com.suse.manager/" -i $SRPM_PKG_DIR/Dockerfile
sed "s/^ARG VENDOR=.*$/ARG VENDOR=\"SUSE LLC\"/" -i $SRPM_PKG_DIR/Dockerfile
sed "s/^ARG PRODUCT=.*$/ARG PRODUCT=\"SUSE Manager\"/" -i $SRPM_PKG_DIR/Dockerfile
Expand All @@ -298,6 +299,7 @@ while read PKG_NAME; do
NAME="uyuni\/${NAME}"
fi

sed "/^ARG REFERENCE_PREFIX=.*$/aARG PRODUCT_VERSION=\"${PRODUCT_VERSION}\"" -i $SRPM_PKG_DIR/Dockerfile
# Add version from rhn_web on top of version from tito to have a continuity with already relased versions
sed "/^#\!BuildTag:/s/$/ ${NAME}:${PRODUCT_VERSION} ${NAME}:${PRODUCT_VERSION}.%RELEASE%/" -i $SRPM_PKG_DIR/Dockerfile
fi
Expand All @@ -320,6 +322,7 @@ while read PKG_NAME; do
NAME="uyuni\/${NAME}"
fi

sed "/^version:.\+$/aappVersion: \"${PRODUCT_VERSION}\"" -i $SRPM_PKG_DIR/Chart.yaml
# Remove leading zero from Uyuni release and add potentially missing micro part
SEMANTIC_VERSION=$(echo ${PRODUCT_VERSION} | sed 's/\([0-9]\+\)\.0\?\([1-9][0-9]*\)\(\.\([0-9]\+\)\)\?\( .\+\)\?/\1.\2.\4\5/' | sed 's/\.$/.0/')
# Also include the semantic version since helm chart wants it for OCI repos (those generated by OBS)
Expand Down
1 change: 1 addition & 0 deletions uyuni-releng-tools.changes.cbosdonnat.container-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Use product version in Dockerfile and Charts.yaml

0 comments on commit d2d2241

Please sign in to comment.