From 7b843abbf4c463b15ff08c21744b9cd364903c76 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 15 May 2020 10:49:52 +0200 Subject: install_test_local.sh: install locally built pkg Change-Id: I43bed64735c442304b8578e186e1591c0ca6f8d7 --- rpm-local/install_test_local.sh | 19 +++++++++++++++++++ rpm-local/scripts/install_test_local.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100755 rpm-local/install_test_local.sh create mode 100755 rpm-local/scripts/install_test_local.sh diff --git a/rpm-local/install_test_local.sh b/rpm-local/install_test_local.sh new file mode 100755 index 0000000..7e32b60 --- /dev/null +++ b/rpm-local/install_test_local.sh @@ -0,0 +1,19 @@ +#!/bin/sh -ex +DIR="$(cd "$(dirname "$0")" && pwd -P)" +IMAGE="centos8" + +if ! [ -e ".build.docker.$IMAGE" ]; then + echo "ERROR: run build.sh first, to generate the docker img" + exit 1 +fi + + +docker run \ + -it \ + --rm \ + -v "$DIR/rpmbuild:/home/user/rpmbuild" \ + -v "$DIR/scripts:/scripts" \ + -v "$DIR/cache/$IMAGE/dnf:/var/cache/dnf" \ + -v "$DIR/cache/distfiles:/home/user/distfiles" \ + "$IMAGE:latest" \ + /scripts/install_test_local.sh diff --git a/rpm-local/scripts/install_test_local.sh b/rpm-local/scripts/install_test_local.sh new file mode 100755 index 0000000..6214e31 --- /dev/null +++ b/rpm-local/scripts/install_test_local.sh @@ -0,0 +1,27 @@ +#!/bin/sh -ex +ARCHES="x86_64 noarch" + +cd /home/user/rpmbuild/RPMS + +# if already built packages exist, run createrepo and add it as local repo +for arch in $ARCHES; do + if [ -d "$arch" ]; then + cd "$arch" + createrepo . + + cat <<- EOF > /etc/yum.repos.d/rpmbuild-local-$arch.repo + [osmocom-$arch] + name=Local Osmocom packages ($arch) + baseurl=file:///home/user/rpmbuild/RPMS/$arch + enabled=1 + gpgcheck=0 + EOF + + cd .. + fi +done + +# Remove local repo related cache +rm -rf /var/cache/dnf/osmocom* + +dnf --setopt=keepcache=1 -y install osmo-trx-uhd -- cgit v1.2.3