Commit 0589a62c authored by Markus Frosch's avatar Markus Frosch
Browse files

Add support for ICINGA_BUILD_EXTRA_REPOSITORY on SUSE

parent 7627aad2
Pipeline #4197 passed with stage
in 15 seconds
......@@ -12,6 +12,39 @@ if [ "$(echo "${source_rpm}" | wc -l)" -gt 1 ]; then
exit 1
fi
if [ -n "${ICINGA_BUILD_EXTRA_REPOSITORY}" ]; then
echo "[ Update extra repository ]"
extra_repository="${ICINGA_BUILD_EXTRA_REPOSITORY}"
if [ -n "${ICINGA_BUILD_EXTRA_REPOSITORY_BASE}" ]; then
extra_repository="${ICINGA_BUILD_EXTRA_REPOSITORY_BASE}/${extra_repository}"
fi # base
extra_name=icinga-build-extra
case "$ICINGA_BUILD_OS" in
opensuse*|sles)
if [ -n "${ICINGA_BUILD_EXTRA_REPOSITORY_USERNAME}" ]; then
echo "Creating /etc/zypp/credentials.d/${extra_name}"
extra_repository="${extra_repository}?credentials=${extra_name}"
(
echo "username=${ICINGA_BUILD_EXTRA_REPOSITORY_USERNAME}"
echo "password=${ICINGA_BUILD_EXTRA_REPOSITORY_PASSWORD}"
) | sudo bash -c "cat >'/etc/zypp/credentials.d/${extra_name}'"
fi
(
set -ex
sudo zypper --non-interactive removerepo "${extra_name}" || true
sudo zypper --non-interactive addrepo --priority 50 --refresh "${extra_repository}" "${extra_name}"
)
;;
*)
# TODO: implement
echo "Other OS than SUSE are not yet implemented!" >&2
#exit 1
;;
esac # ICINGA_BUILD_OS
fi # ICINGA_BUILD_EXTRA_REPOSITORY
echo "[ Update package cache ]"
case "$ICINGA_BUILD_OS" in
opensuse*|sles)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment