jenkins: per build, drop programs built "unintentionally"
Each of the jenkins-build-* scripts intends to build a specific set of
programs. While compiling dependencies, other programs may end up in
$prefix/bin. Drop those other binaries to reduce potential confusion.
Add arguments to the create_bin_tgz function: callers need to list exactly the
$prefix/bin/* binaries that should be tar'd. All others are first removed from
the prefix.
Adjust existing scripts to provide such binary names.
Change-Id: Ib1a00b2149453fedf9ece0460dd4d6e83f774d45
diff --git a/contrib/jenkins-build-common.sh b/contrib/jenkins-build-common.sh
index 3e30873..3d9932d 100644
--- a/contrib/jenkins-build-common.sh
+++ b/contrib/jenkins-build-common.sh
@@ -140,6 +140,22 @@
create_bin_tgz() {
# build the archive that is going to be copied to the tester
+
+ wanted_binaries="$@"
+
+ if [ -z "$wanted_binaries" ]; then
+ set +x; echo "ERROR: create_bin_tgz needs a list of permitted binaries"; set -x
+ exit 1
+ fi
+
+ # remove binaries not intended to originate from this build
+ cd "$prefix_real"/bin
+ for f in * ; do
+ if [ -z "$(echo "_ $wanted_binaries _" | grep " $f ")" ]; then
+ rm "$f"
+ fi
+ done
+
cd "$prefix_real"
this="$name.build-${BUILD_NUMBER-$(date +%Y-%m-%d_%H_%M_%S)}"
tar="${this}.tgz"
diff --git a/contrib/jenkins-build-osmo-bts-sysmo.sh b/contrib/jenkins-build-osmo-bts-sysmo.sh
index f286368..e636893 100755
--- a/contrib/jenkins-build-osmo-bts-sysmo.sh
+++ b/contrib/jenkins-build-osmo-bts-sysmo.sh
@@ -20,4 +20,4 @@
build_repo libosmo-abis
build_repo osmo-bts --enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include
-create_bin_tgz
+create_bin_tgz osmo-bts-sysmo
diff --git a/contrib/jenkins-build-osmo-bts-trx.sh b/contrib/jenkins-build-osmo-bts-trx.sh
index 8664a08..6188be1 100755
--- a/contrib/jenkins-build-osmo-bts-trx.sh
+++ b/contrib/jenkins-build-osmo-bts-trx.sh
@@ -11,4 +11,4 @@
build_repo libosmo-abis
build_repo osmo-bts --enable-trx --with-openbsc=$base/openbsc/openbsc/include
-create_bin_tgz
+create_bin_tgz osmo-bts-trx
diff --git a/contrib/jenkins-build-osmo-hlr.sh b/contrib/jenkins-build-osmo-hlr.sh
index 67e135f..460e9d6 100755
--- a/contrib/jenkins-build-osmo-hlr.sh
+++ b/contrib/jenkins-build-osmo-hlr.sh
@@ -8,4 +8,4 @@
build_repo libosmo-abis
build_repo osmo-hlr
-create_bin_tgz
+create_bin_tgz osmo-hlr
diff --git a/contrib/jenkins-build-osmo-msc.sh b/contrib/jenkins-build-osmo-msc.sh
index dddacc7..8025ca2 100755
--- a/contrib/jenkins-build-osmo-msc.sh
+++ b/contrib/jenkins-build-osmo-msc.sh
@@ -14,4 +14,4 @@
build_repo osmo-iuh neels/sigtran # TEMPORARY BRANCH
build_repo openbsc aoip --enable-smpp --enable-osmo-bsc --enable-nat --enable-iu
-create_bin_tgz
+create_bin_tgz osmo-msc
diff --git a/contrib/jenkins-build-osmo-nitb.sh b/contrib/jenkins-build-osmo-nitb.sh
index 2f26a20..ef55259 100755
--- a/contrib/jenkins-build-osmo-nitb.sh
+++ b/contrib/jenkins-build-osmo-nitb.sh
@@ -12,4 +12,4 @@
build_repo libosmo-sccp
build_repo openbsc --enable-smpp --enable-osmo-bsc --enable-nat
-create_bin_tgz
+create_bin_tgz osmo-nitb
diff --git a/contrib/jenkins-build-osmo-pcu-sysmo.sh b/contrib/jenkins-build-osmo-pcu-sysmo.sh
index b912252..c38bc33 100755
--- a/contrib/jenkins-build-osmo-pcu-sysmo.sh
+++ b/contrib/jenkins-build-osmo-pcu-sysmo.sh
@@ -16,4 +16,4 @@
build_repo libosmocore --disable-pcsc --disable-doxygen
build_repo osmo-pcu --enable-sysmocom-dsp
-create_bin_tgz
+create_bin_tgz osmo-pcu
diff --git a/contrib/jenkins-build-osmo-pcu.sh b/contrib/jenkins-build-osmo-pcu.sh
index 7953875..4d4277f 100755
--- a/contrib/jenkins-build-osmo-pcu.sh
+++ b/contrib/jenkins-build-osmo-pcu.sh
@@ -7,4 +7,4 @@
build_repo libosmocore --disable-pcsc --disable-doxygen
build_repo osmo-pcu
-create_bin_tgz
+create_bin_tgz osmo-pcu
diff --git a/contrib/jenkins-build-osmo-trx.sh b/contrib/jenkins-build-osmo-trx.sh
index 7d2a5b6..b996cfe 100755
--- a/contrib/jenkins-build-osmo-trx.sh
+++ b/contrib/jenkins-build-osmo-trx.sh
@@ -6,4 +6,4 @@
build_repo osmo-trx --without-sse
-create_bin_tgz
+create_bin_tgz osmo-trx