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
This commit is contained in:
Neels Hofmeyr 2017-09-04 16:34:18 +02:00
parent d3fce46f58
commit 1921c0f6c9
9 changed files with 24 additions and 8 deletions

View File

@ -140,6 +140,22 @@ build_repo() {
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"

View File

@ -20,4 +20,4 @@ build_repo libosmocore --disable-pcsc --disable-doxygen
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

View File

@ -11,4 +11,4 @@ build_repo libosmocore --disable-doxygen
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

View File

@ -8,4 +8,4 @@ build_repo libosmocore --disable-doxygen
build_repo libosmo-abis
build_repo osmo-hlr
create_bin_tgz
create_bin_tgz osmo-hlr

View File

@ -14,4 +14,4 @@ build_repo libasn1c
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

View File

@ -12,4 +12,4 @@ build_repo libsmpp34
build_repo libosmo-sccp
build_repo openbsc --enable-smpp --enable-osmo-bsc --enable-nat
create_bin_tgz
create_bin_tgz osmo-nitb

View File

@ -16,4 +16,4 @@ prefix_real="$DESTDIR$prefix"
build_repo libosmocore --disable-pcsc --disable-doxygen
build_repo osmo-pcu --enable-sysmocom-dsp
create_bin_tgz
create_bin_tgz osmo-pcu

View File

@ -7,4 +7,4 @@ name="osmo-pcu"
build_repo libosmocore --disable-pcsc --disable-doxygen
build_repo osmo-pcu
create_bin_tgz
create_bin_tgz osmo-pcu

View File

@ -6,4 +6,4 @@ name="osmo-trx"
build_repo osmo-trx --without-sse
create_bin_tgz
create_bin_tgz osmo-trx