Accepting request 1039303 from home:vulyanov:branches:Virtualization
- Ensure RPMs and containers are built against the same distro - Be more strict when discovering the registry path: error out if the distro is unknown, instead of falling through to 'opensuse' by default OBS-URL: https://build.opensuse.org/request/show/1039303 OBS-URL: https://build.opensuse.org/package/show/Virtualization/containerized-data-importer?expand=0&rev=61
This commit is contained in:
parent
bc3914adf2
commit
52cdbfb21a
@ -1,10 +1,16 @@
|
||||
#!/bin/bash
|
||||
#!/bin/bash -xe
|
||||
|
||||
TAGPREFIX=_TAGPREFIX_
|
||||
LABELPREFIX=_LABELPREFIX_
|
||||
REGISTRY=_REGISTRY_
|
||||
PKG_VERSION=_PKG_VERSION_
|
||||
PKG_RELEASE=_PKG_RELEASE_
|
||||
DISTRO=_DISTRO_
|
||||
|
||||
# Set HOME=/root as a workaround for
|
||||
# https://github.com/openSUSE/obs-build/issues/901
|
||||
_distro=$(HOME=/root rpm --eval '%{?sle_version}:%{?is_opensuse}%{!?is_opensuse:0}')
|
||||
[ "${DISTRO}" == "${_distro}" ] || exit 1
|
||||
|
||||
if [ -n "${pkg}" ]; then
|
||||
if rpm -q ${pkg}; then
|
||||
|
@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 1 09:58:30 UTC 2022 - Vasily Ulyanov <vasily.ulyanov@suse.com>
|
||||
|
||||
- Ensure RPMs and containers are built against the same distro
|
||||
- Be more strict when discovering the registry path: error out if the
|
||||
distro is unknown, instead of falling through to 'opensuse' by
|
||||
default
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Oct 15 13:41:00 UTC 2022 - Vasily Ulyanov <vasily.ulyanov@suse.com>
|
||||
|
||||
|
@ -156,11 +156,15 @@ case "${distro}" in
|
||||
labelprefix=com.suse.kubevirt
|
||||
registry=registry.suse.com
|
||||
;;
|
||||
*)
|
||||
*:1)
|
||||
tagprefix=kubevirt
|
||||
labelprefix=org.opensuse.kubevirt
|
||||
registry=registry.opensuse.org
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported distro: ${distro}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
%if "%{?kubevirt_registry_path}" == ""
|
||||
@ -175,6 +179,7 @@ sed -i"" \
|
||||
-e "s#_REGISTRY_#${registry}#g" \
|
||||
-e "s#_PKG_VERSION_#%{version}#g" \
|
||||
-e "s#_PKG_RELEASE_#%{release}#g" \
|
||||
-e "s#_DISTRO_#${distro}#g" \
|
||||
%{S:1}
|
||||
|
||||
export GOPATH=%{_builddir}/go
|
||||
|
Loading…
Reference in New Issue
Block a user