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

set BuildTag for Dockerfile and Chart.yaml using push-packages-to-obs.sh #7620

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions containers/proxy-helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: MIT
#!BuildTag: uyuni/proxy-helm:latest uyuni/proxy-helm:4.4.1 uyuni/proxy-helm:4.4.1-build%RELEASE%
#!BuildTag: uyuni/proxy:latest
apiVersion: v2
name: proxy-helm
name: proxy
description: Uyuni proxy containers.
type: application
home: https://www.uyuni-project.org/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove statically defined image tags
2 changes: 1 addition & 1 deletion containers/proxy-httpd-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: MIT
#!BuildTag: uyuni/proxy-httpd:latest uyuni/proxy-httpd:4.4.1 uyuni/proxy-httpd:4.4.1.%RELEASE%
#!BuildTag: uyuni/proxy-httpd:latest

ARG BASE=registry.suse.com/bci/bci-base:15.5
FROM $BASE AS base
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove statically defined image tags
2 changes: 1 addition & 1 deletion containers/proxy-salt-broker-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: MIT
#!BuildTag: uyuni/proxy-salt-broker:latest uyuni/proxy-salt-broker:4.4.1 uyuni/proxy-salt-broker:4.4.1.%RELEASE%
#!BuildTag: uyuni/proxy-salt-broker:latest

ARG BASE=registry.suse.com/bci/bci-base:15.5
FROM $BASE AS fat
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove statically defined image tags
2 changes: 1 addition & 1 deletion containers/proxy-squid-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: MIT
#!BuildTag: uyuni/proxy-squid:latest uyuni/proxy-squid:4.4.1 uyuni/proxy-squid:4.4.1.%RELEASE%
#!BuildTag: uyuni/proxy-squid:latest

ARG BASE=registry.suse.com/bci/bci-base:15.5
FROM $BASE AS base
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove statically defined image tags
2 changes: 1 addition & 1 deletion containers/proxy-ssh-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: MIT
#!BuildTag: uyuni/proxy-ssh:latest uyuni/proxy-ssh:4.4.1 uyuni/proxy-ssh:4.4.1.%RELEASE%
#!BuildTag: uyuni/proxy-ssh:latest

ARG BASE=registry.suse.com/bci/bci-base:15.5
FROM $BASE AS base
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove statically defined image tags
2 changes: 1 addition & 1 deletion containers/proxy-tftpd-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: MIT
#!BuildTag: uyuni/proxy-tftpd:latest uyuni/proxy-tftpd:4.4.1 uyuni/proxy-tftpd:4.4.1.%RELEASE%
#!BuildTag: uyuni/proxy-tftpd:latest

ARG BASE=registry.suse.com/bci/bci-base:15.5
FROM $BASE AS base
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove statically defined image tags
11 changes: 7 additions & 4 deletions rel-eng/push-packages-to-obs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ FAILED_PKG=

# check which endpoint we are using to match the product
if [ "${OSCAPI}" == "https://api.suse.de" ]; then
PRODUCT_VERSION="susemanager-$(sed -n 's/.*web.version\s*=\s*\(.*\)$/\1/p' ${BASE_DIR}/../web/conf/rhn_web.conf)"
PRODUCT_VERSION="$(sed -n 's/.*web.version\s*=\s*\(.*\)$/\1/p' ${BASE_DIR}/../web/conf/rhn_web.conf)"
else
# Uyuni settings
PRODUCT_VERSION="uyuni-$(sed -n 's/.*web.version.uyuni\s*=\s*\(.*\)$/\1/p' ${BASE_DIR}/../web/conf/rhn_web.conf)"
PRODUCT_VERSION="$(sed -n 's/.*web.version.uyuni\s*=\s*\(.*\)$/\1/p' ${BASE_DIR}/../web/conf/rhn_web.conf)"
fi
# to lowercase with ",," and replace spaces " " with "-"
PRODUCT_VERSION=$(echo ${PRODUCT_VERSION,,} | sed -r 's/ /-/g')
Expand Down Expand Up @@ -282,7 +282,7 @@ while read PKG_NAME; do
fi

if [ -f "$SRPM_PKG_DIR/Chart.yaml" ]; then
NAME="${PKG_NAME}"
NAME="${PKG_NAME%%-helm}"
if [ "${OSCAPI}" == "https://api.suse.de" ]; then
# SUSE Manager settings
VERSION=$(sed 's/^\([0-9]\+\.[0-9]\+\).*$/\1/' ${BASE_DIR}/packages/uyuni-base)
Expand All @@ -299,7 +299,10 @@ while read PKG_NAME; do
NAME="uyuni\/${NAME}"
fi

sed "/^#\!BuildTag:/ s/$/ ${NAME}:${PRODUCT_VERSION} ${NAME}:${PRODUCT_VERSION}.%RELEASE%/" -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)
sed "/^#\!BuildTag:/ s/$/ ${NAME}:${SEMANTIC_VERSION} ${NAME}:${PRODUCT_VERSION} ${NAME}:${PRODUCT_VERSION}.%RELEASE%/" -i $SRPM_PKG_DIR/Chart.yaml
fi

# update from obs (create missing package on the fly)
Expand Down