2016-04-13 23:03:38 +00:00
|
|
|
#!/usr/bin/env bash
|
2021-10-20 17:47:48 +00:00
|
|
|
# jenkins build helper script for osmo-bsc. This is how we build on jenkins.osmocom.org
|
2018-11-28 10:33:39 +00:00
|
|
|
#
|
|
|
|
# environment variables:
|
|
|
|
# * WITH_MANUALS: build manual PDFs if set to "1"
|
|
|
|
# * PUBLISH: upload manuals after building if set to "1" (ignored without WITH_MANUALS = "1")
|
2023-05-23 14:05:17 +00:00
|
|
|
# * IS_MASTER_BUILD: set to 1 when running from master-builds (not gerrit-verifications)
|
2018-11-28 10:33:39 +00:00
|
|
|
#
|
2017-07-10 13:00:00 +00:00
|
|
|
|
2023-05-23 14:05:17 +00:00
|
|
|
exit_tar_workspace() {
|
|
|
|
if [ "$IS_MASTER_BUILD" = "1" ]; then
|
|
|
|
tar -cJf "/tmp/workspace.tar.xz" "$base"
|
|
|
|
mv /tmp/workspace.tar.xz "$base"
|
|
|
|
fi
|
|
|
|
|
2023-05-27 19:58:47 +00:00
|
|
|
cat-testlogs.sh
|
2023-05-23 14:05:17 +00:00
|
|
|
}
|
|
|
|
|
2017-07-10 13:00:00 +00:00
|
|
|
if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then
|
|
|
|
echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
2016-04-13 23:03:38 +00:00
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2016-07-11 17:39:51 +00:00
|
|
|
base="$PWD"
|
|
|
|
deps="$base/deps"
|
|
|
|
inst="$deps/install"
|
2016-10-06 22:58:22 +00:00
|
|
|
export deps inst
|
2016-07-11 17:39:51 +00:00
|
|
|
|
2017-10-27 20:54:22 +00:00
|
|
|
osmo-clean-workspace.sh
|
|
|
|
|
2016-07-11 17:39:51 +00:00
|
|
|
mkdir "$deps" || true
|
|
|
|
|
2017-12-21 14:00:33 +00:00
|
|
|
osmo-build-dep.sh libosmocore "" '--disable-doxygen --enable-gnutls'
|
2016-07-11 17:39:51 +00:00
|
|
|
|
2017-08-26 19:19:35 +00:00
|
|
|
verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
|
2017-03-01 14:06:16 +00:00
|
|
|
|
2022-04-22 11:39:11 +00:00
|
|
|
# Check for wrong use of osmo_bts_has_feature (OS#5538)
|
2022-04-28 10:04:36 +00:00
|
|
|
bts_features_wrong_use="$(grep -r -n 'osmo_bts_has_feature.*->model->features' \
|
|
|
|
| grep -v 'jenkins.sh' \
|
|
|
|
| grep -v 'intentional check against bts model')" || true
|
2022-04-22 11:39:11 +00:00
|
|
|
if [ -n "$bts_features_wrong_use" ]; then
|
|
|
|
set +x
|
|
|
|
echo
|
|
|
|
echo "ERROR: Don't use osmo_bts_has_feature with bts->model->features. Use bts->features instead."
|
|
|
|
echo
|
|
|
|
echo "$bts_features_wrong_use"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2016-07-11 17:39:51 +00:00
|
|
|
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
|
2016-10-06 22:58:22 +00:00
|
|
|
export LD_LIBRARY_PATH="$inst/lib"
|
2018-11-28 10:33:39 +00:00
|
|
|
export PATH="$inst/bin:$PATH"
|
2016-07-11 17:39:51 +00:00
|
|
|
|
2016-10-06 22:58:22 +00:00
|
|
|
osmo-build-dep.sh libosmo-abis
|
2017-03-31 12:03:39 +00:00
|
|
|
osmo-build-dep.sh libosmo-netif
|
2017-04-09 10:32:51 +00:00
|
|
|
osmo-build-dep.sh libosmo-sccp
|
2017-09-03 20:45:09 +00:00
|
|
|
osmo-build-dep.sh osmo-mgw
|
2016-07-11 17:39:51 +00:00
|
|
|
|
2018-11-28 10:33:39 +00:00
|
|
|
# Additional configure options and depends
|
2023-07-11 10:34:49 +00:00
|
|
|
CONFIG="
|
|
|
|
--enable-external-tests
|
|
|
|
--enable-meas-pcap2db
|
|
|
|
--enable-meas-udp2db
|
|
|
|
--enable-meas-vis
|
|
|
|
--enable-werror
|
|
|
|
"
|
2018-11-28 10:33:39 +00:00
|
|
|
if [ "$WITH_MANUALS" = "1" ]; then
|
2023-07-11 09:33:17 +00:00
|
|
|
CONFIG="$CONFIG --enable-manuals"
|
2018-11-28 10:33:39 +00:00
|
|
|
fi
|
|
|
|
|
2016-10-06 22:58:22 +00:00
|
|
|
set +x
|
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo
|
2017-09-23 12:15:46 +00:00
|
|
|
echo " =============================== osmo-bsc ==============================="
|
2016-10-06 22:58:22 +00:00
|
|
|
echo
|
|
|
|
set -x
|
|
|
|
|
2016-07-11 17:39:51 +00:00
|
|
|
cd "$base"
|
2016-04-13 23:03:38 +00:00
|
|
|
autoreconf --install --force
|
2023-07-11 09:33:17 +00:00
|
|
|
./configure --enable-sanitize $CONFIG
|
2016-07-11 17:39:51 +00:00
|
|
|
$MAKE $PARALLEL_MAKE
|
2016-10-06 22:58:22 +00:00
|
|
|
LD_LIBRARY_PATH="$inst/lib" $MAKE check \
|
2023-05-23 14:05:17 +00:00
|
|
|
|| exit_tar_workspace
|
2017-07-20 15:57:37 +00:00
|
|
|
LD_LIBRARY_PATH="$inst/lib" \
|
2023-07-11 09:33:17 +00:00
|
|
|
DISTCHECK_CONFIGURE_FLAGS="$CONFIG" \
|
2020-10-12 17:39:40 +00:00
|
|
|
$MAKE $PARALLEL_MAKE distcheck \
|
2023-05-23 14:05:17 +00:00
|
|
|
|| exit_tar_workspace
|
2017-10-27 20:54:22 +00:00
|
|
|
|
2018-11-28 10:33:39 +00:00
|
|
|
if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
|
|
|
|
make -C "$base/doc/manuals" publish
|
|
|
|
fi
|
|
|
|
|
2020-10-12 17:39:40 +00:00
|
|
|
$MAKE $PARALLEL_MAKE maintainer-clean
|
2017-10-27 20:54:22 +00:00
|
|
|
osmo-clean-workspace.sh
|