mirror of https://gerrit.osmocom.org/osmo-ci
repo-install-test: adjust for obs.osmocom.org
Related: OS#5557 Change-Id: Ib53df6c40ae92634e6d93389dcb8a21c48dfb63d
This commit is contained in:
parent
4cb6289b51
commit
4f766e6028
|
@ -2,8 +2,8 @@
|
||||||
# Environment variables:
|
# Environment variables:
|
||||||
# * INTERACTIVE: set to 1 to keep an interactive shell open after the script ran (for debugging)
|
# * INTERACTIVE: set to 1 to keep an interactive shell open after the script ran (for debugging)
|
||||||
# * FEED: binary package feed (e.g. "latest", "nightly")
|
# * FEED: binary package feed (e.g. "latest", "nightly")
|
||||||
# * PROJ: OBS project namespace (e.g. "network:osmocom:latest")
|
# * PROJ: OBS project namespace (e.g. "osmocom:latest")
|
||||||
# * PROJ_CONFLICT: Conflicting OBS project namespace (e.g. "network:osmocom:nightly")
|
# * PROJ_CONFLICT: Conflicting OBS project namespace (e.g. "osmocom:nightly")
|
||||||
# * KEEP_CACHE: set to 1 to keep downloaded binary packages (for development)
|
# * KEEP_CACHE: set to 1 to keep downloaded binary packages (for development)
|
||||||
# * TESTS: which tests to run (all by default, see below for possible values)
|
# * TESTS: which tests to run (all by default, see below for possible values)
|
||||||
. "$(dirname "$0")/common.sh"
|
. "$(dirname "$0")/common.sh"
|
||||||
|
@ -31,7 +31,7 @@ check_usage
|
||||||
docker_images_require "$DISTRO-repo-install-test"
|
docker_images_require "$DISTRO-repo-install-test"
|
||||||
|
|
||||||
FEED="${FEED:-nightly}"
|
FEED="${FEED:-nightly}"
|
||||||
PROJ="${PROJ:-network:osmocom:$FEED}"
|
PROJ="${PROJ:-osmocom:$FEED}"
|
||||||
CONTAINER="$DISTRO-repo-install-test-$FEED"
|
CONTAINER="$DISTRO-repo-install-test-$FEED"
|
||||||
|
|
||||||
if [ -z "$TESTS" ]; then
|
if [ -z "$TESTS" ]; then
|
||||||
|
@ -46,13 +46,13 @@ fi
|
||||||
if [ -z "$PROJ_CONFLICT" ]; then
|
if [ -z "$PROJ_CONFLICT" ]; then
|
||||||
case "$FEED" in
|
case "$FEED" in
|
||||||
latest)
|
latest)
|
||||||
PROJ_CONFLICT="network:osmocom:nightly"
|
PROJ_CONFLICT="osmocom:nightly"
|
||||||
;;
|
;;
|
||||||
nightly)
|
nightly)
|
||||||
PROJ_CONFLICT="network:osmocom:latest"
|
PROJ_CONFLICT="osmocom:latest"
|
||||||
;;
|
;;
|
||||||
next)
|
next)
|
||||||
PROJ_CONFLICT="network:osmocom:nightly"
|
PROJ_CONFLICT="osmocom:nightly"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/sh -ex
|
#!/bin/sh -ex
|
||||||
# Environment variables:
|
# Environment variables:
|
||||||
# * FEED: binary package feed (e.g. "latest", "nightly")
|
# * FEED: binary package feed (e.g. "latest", "nightly")
|
||||||
# * PROJ: OBS project namespace (e.g. "network:osmocom:latest")
|
# * PROJ: OBS project namespace (e.g. "osmocom:latest")
|
||||||
# * PROJ_CONFLICT: Conflicting OBS project namespace (e.g. "network:osmocom:nightly")
|
# * PROJ_CONFLICT: Conflicting OBS project namespace (e.g. "osmocom:nightly")
|
||||||
# * KEEP_CACHE: set to 1 to keep downloaded binary packages (for development)
|
# * KEEP_CACHE: set to 1 to keep downloaded binary packages (for development)
|
||||||
# * DISTRO: linux distribution name (e.g. "centos8")
|
# * DISTRO: linux distribution name (e.g. "centos8")
|
||||||
# * TESTS: which tests to run (see repo-install-test.sh)
|
# * TESTS: which tests to run (see repo-install-test.sh)
|
||||||
|
@ -54,12 +54,12 @@ distro_obsdir() {
|
||||||
|
|
||||||
DISTRO_OBSDIR="$(distro_obsdir)"
|
DISTRO_OBSDIR="$(distro_obsdir)"
|
||||||
|
|
||||||
# $1: OBS project (e.g. "network:osmocom:nightly" -> "network:/osmocom:/nightly")
|
# $1: OBS project (e.g. "osmocom:nightly" -> "osmocom:/nightly")
|
||||||
proj_with_slashes() {
|
proj_with_slashes() {
|
||||||
echo "$1" | sed "s.:.:/.g"
|
echo "$1" | sed "s.:.:/.g"
|
||||||
}
|
}
|
||||||
|
|
||||||
# $1: OBS project (e.g. "network:osmocom:nightly" -> "network_osmocom_nightly")
|
# $1: OBS project (e.g. "osmocom:nightly" -> "osmocom_nightly")
|
||||||
proj_with_underscore() {
|
proj_with_underscore() {
|
||||||
echo "$1" | tr : _
|
echo "$1" | tr : _
|
||||||
}
|
}
|
||||||
|
@ -96,10 +96,10 @@ check_env() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# $1: OBS project (e.g. "network:osmocom:nightly")
|
# $1: OBS project (e.g. "osmocom:nightly")
|
||||||
configure_osmocom_repo_debian() {
|
configure_osmocom_repo_debian() {
|
||||||
local proj="$1"
|
local proj="$1"
|
||||||
local obs_repo="download.opensuse.org/repositories/$(proj_with_slashes "$proj")/$DISTRO_OBSDIR/"
|
local obs_repo="downloads.osmocom.org/packages/$(proj_with_slashes "$proj")/$DISTRO_OBSDIR/"
|
||||||
|
|
||||||
echo "Configuring Osmocom repository"
|
echo "Configuring Osmocom repository"
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ configure_osmocom_repo_debian() {
|
||||||
if ! [ -e "$release_key" ]; then
|
if ! [ -e "$release_key" ]; then
|
||||||
apt-get update
|
apt-get update
|
||||||
apt install -y wget
|
apt install -y wget
|
||||||
wget -O /tmp/Release.key "https://build.opensuse.org/projects/network:osmocom/public_key"
|
wget -O /tmp/Release.key "https://obs.osmocom.org/projects/$proj/public_key"
|
||||||
fi
|
fi
|
||||||
apt-key add /tmp/Release.key
|
apt-key add /tmp/Release.key
|
||||||
|
|
||||||
|
@ -115,20 +115,20 @@ configure_osmocom_repo_debian() {
|
||||||
apt-get update
|
apt-get update
|
||||||
}
|
}
|
||||||
|
|
||||||
# $1: OBS project (e.g. "network:osmocom:nightly")
|
# $1: OBS project (e.g. "osmocom:nightly")
|
||||||
configure_osmocom_repo_debian_remove() {
|
configure_osmocom_repo_debian_remove() {
|
||||||
local proj="$1"
|
local proj="$1"
|
||||||
rm "/etc/apt/sources.list.d/$proj.list"
|
rm "/etc/apt/sources.list.d/$proj.list"
|
||||||
}
|
}
|
||||||
|
|
||||||
# $1: OBS project (e.g. "network:osmocom:nightly")
|
# $1: OBS project (e.g. "osmocom:nightly")
|
||||||
configure_osmocom_repo_centos() {
|
configure_osmocom_repo_centos() {
|
||||||
local proj="$1"
|
local proj="$1"
|
||||||
local baseurl="https://download.opensuse.org/repositories/$(proj_with_slashes "$proj")/$DISTRO_OBSDIR"
|
local baseurl="https://downloads.osmocom.org/packages/$(proj_with_slashes "$proj")/$DISTRO_OBSDIR"
|
||||||
|
|
||||||
echo "Configuring Osmocom repository"
|
echo "Configuring Osmocom repository"
|
||||||
# Generate this file, based on the feed:
|
# Generate this file, based on the feed:
|
||||||
# https://download.opensuse.org/repositories/network:osmocom:latest/CentOS_8/network:osmocom:latest.repo
|
# https://downloads.osmocom.org/packages/osmocom:/latest/CentOS_8/osmocom:latest.repo
|
||||||
cat << EOF > "/etc/yum.repos.d/$proj.repo"
|
cat << EOF > "/etc/yum.repos.d/$proj.repo"
|
||||||
[$(proj_with_underscore "$proj")]
|
[$(proj_with_underscore "$proj")]
|
||||||
name=$proj
|
name=$proj
|
||||||
|
@ -140,13 +140,13 @@ enabled=1
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
# $1: OBS project (e.g. "network:osmocom:nightly")
|
# $1: OBS project (e.g. "osmocom:nightly")
|
||||||
configure_osmocom_repo_centos_remove() {
|
configure_osmocom_repo_centos_remove() {
|
||||||
local proj="$1"
|
local proj="$1"
|
||||||
rm "/etc/yum.repos.d/$proj.repo"
|
rm "/etc/yum.repos.d/$proj.repo"
|
||||||
}
|
}
|
||||||
|
|
||||||
# $1: OBS project (e.g. "network:osmocom:nightly")
|
# $1: OBS project (e.g. "osmocom:nightly")
|
||||||
configure_osmocom_repo() {
|
configure_osmocom_repo() {
|
||||||
case "$DISTRO" in
|
case "$DISTRO" in
|
||||||
debian*)
|
debian*)
|
||||||
|
@ -285,14 +285,12 @@ filter_packages_txt() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install_repo_packages_debian() {
|
install_repo_packages_debian() {
|
||||||
local obs="obs://build.opensuse.org/$PROJ/$DISTRO_OBSDIR"
|
|
||||||
|
|
||||||
echo "Installing all repository packages"
|
echo "Installing all repository packages"
|
||||||
|
|
||||||
# Get a list of all packages from the repository. Reference:
|
# Get a list of all packages from the repository. Reference:
|
||||||
# https://www.debian.org/doc/manuals/aptitude/ch02s04s05.en.html
|
# https://www.debian.org/doc/manuals/aptitude/ch02s04s05.en.html
|
||||||
aptitude search -F%p \
|
aptitude search -F%p \
|
||||||
"?origin($obs) ?architecture(native)" | sort \
|
"?origin(.*$PROJ.*) ?architecture(native)" | sort \
|
||||||
> osmocom_packages_all.txt
|
> osmocom_packages_all.txt
|
||||||
|
|
||||||
filter_packages_txt
|
filter_packages_txt
|
||||||
|
|
Loading…
Reference in New Issue