aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2020-05-15 10:49:52 +0200
committerOliver Smith <osmith@sysmocom.de>2020-05-15 10:49:52 +0200
commit7b843abbf4c463b15ff08c21744b9cd364903c76 (patch)
tree4f8343536ac76a3c7603d841ff57fb1c519bd342
parent9b15fc763dbf1c4773dd679cee75ee8909f2a7ed (diff)
install_test_local.sh: install locally built pkg
-rwxr-xr-xrpm-local/install_test_local.sh19
-rwxr-xr-xrpm-local/scripts/install_test_local.sh27
2 files changed, 46 insertions, 0 deletions
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