aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/obs/data/build_deb.sh
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2022-08-19 15:22:57 +0200
committerOliver Smith <osmith@sysmocom.de>2022-10-06 09:45:02 +0200
commit449dae8c13aa6ae6b76ca34fe577d5a73b6ec98a (patch)
treeae1122a4b7fe6dc246bec390f3d5450d4ed62eda /scripts/obs/data/build_deb.sh
parentd423d17e0716c1ab4c99fecd03ce16877897137f (diff)
obs: add build_binpkg.py
Add a script to build deb/rpm packages, as it would be done on obs.osmocom.org. This will be used by jenkins to verify deb and rpm builds for each submitted gerrit patch. I have attempted to use 'osc build' instead of directly calling apt-get build-dep and dpkg-buildpackage (and rpm equivalents). Using 'osc build' would have the advantage that the build works as close to the OBS build as possible. However it would try to install dependencies with sudo, so we would need to have sudo available in the docker container that builds the untrusted code from gerrit. Let's not do that. Related: OS#2385 Change-Id: I4c6b5d61af35df98cbc70d9ddc8ad36d38a9ce18
Diffstat (limited to 'scripts/obs/data/build_deb.sh')
-rwxr-xr-xscripts/obs/data/build_deb.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/obs/data/build_deb.sh b/scripts/obs/data/build_deb.sh
new file mode 100755
index 0000000..0030278
--- /dev/null
+++ b/scripts/obs/data/build_deb.sh
@@ -0,0 +1,14 @@
+#!/bin/sh -ex
+
+apt_get="apt-get"
+if [ -n "$INSIDE_DOCKER" ]; then
+ export DEBIAN_FRONTEND=noninteractive
+ apt_get="apt-get -y"
+fi
+
+su "$BUILDUSER" -c "tar -C _temp/binpkgs -xvf _temp/srcpkgs/$PACKAGE/*.tar.*"
+cd _temp/binpkgs/*
+
+$apt_get update
+$apt_get build-dep .
+su "$BUILDUSER" -c "dpkg-buildpackage -us -uc -j$JOBS"