From b78fc1eeee3b8d3a5e7b00e0f8bd89a844123c26 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 22 Jun 2017 19:49:58 +0200 Subject: Simplify jenkins build scripts * move duplicated code into separate functions in jenkins_common.sh * use that function in individual builds Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf --- contrib/jenkins_bts_trx.sh | 21 ++------------------- contrib/jenkins_common.sh | 27 ++++++++++++++++++++++++--- contrib/jenkins_lc15.sh | 15 ++------------- contrib/jenkins_oct.sh | 18 ++---------------- contrib/jenkins_oct_and_bts_trx.sh | 21 ++------------------- contrib/jenkins_sysmobts.sh | 22 ++++------------------ 6 files changed, 36 insertions(+), 88 deletions(-) (limited to 'contrib') diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 9e958097..47ccde38 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -16,26 +16,9 @@ cd "$deps" # Get osmo-pcu for pcuif_proto.h osmo-deps.sh osmo-pcu -cd "$base" - -set +x -echo -echo -echo -echo " =============================== osmo-bts-trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build_bts "osmo-bts-trx" "$configure_flags" diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index bce771d8..78ca0af0 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -25,9 +25,30 @@ cd "$deps" # Get libosmocore for verify_value_string_arrays_are_terminated.py osmo-deps.sh libosmocore -# Get OpenBSC for gsm_data_shared.* -osmo-deps.sh openbsc - cd "$base" "$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") + +# generic project build function, usage: +# build "PROJECT-NAME" "CONFIGURE OPTIONS" +build_bts() { + set +x + echo + echo + echo + echo " =============================== $1 ===============================" + echo + set -x + + cd $deps + osmo-deps.sh openbsc + conf_flags="--with-openbsc=$deps/openbsc/openbsc/include" + cd $base + shift + conf_flags="$conf_flags $*" + autoreconf --install --force + ./configure $conf_flags + $MAKE $PARALLEL_MAKE + $MAKE check || cat-testlogs.sh + DISTCHECK_CONFIGURE_FLAGS=$conf_flags $MAKE distcheck || cat-testlogs.sh +} diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index a2d95149..314d85c0 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -13,18 +13,7 @@ osmo-build-dep.sh libosmo-abis cd "$deps" osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-lc15 ===============================" -echo -set -x +configure_flags="--with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-litecell15="$deps/layer1-headers/inc/" --enable-litecell15 -$MAKE $PARALLEL_MAKE -$MAKE check || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-litecell15=$deps/layer1-headers/inc/ --with-openbsc=$deps/openbsc/openbsc/include --enable-litecell15" $MAKE distcheck || cat-testlogs.sh +build_bts "osmo-bts-lc15" "$configure_flags" diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index b3dc07fd..8a351c53 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -13,21 +13,7 @@ osmo-build-dep.sh libosmo-abis cd "$deps" osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" -cd "$base" -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy ===============================" -echo -set -x +configure_flags="--with-octsdr-2g=$deps/layer1-headers/ --enable-octphy" -autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-headers/" --enable-octphy -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-headers/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ - $MAKE distcheck \ - || cat-testlogs.sh +build_bts "osmo-bts-octphy" "$configure_flags" diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index c23009d1..964fb94f 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -18,28 +18,11 @@ osmo-deps.sh osmo-pcu osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" -cd "$base" - -set +x -echo -echo -echo -echo " =============================== osmo-bts-octphy+trx ===============================" -echo -set -x - -autoreconf --install --force configure_flags="\ - --with-openbsc=$deps/openbsc/openbsc/include \ --with-osmo-pcu=$deps/osmo-pcu/include \ --with-octsdr-2g=$deps/layer1-headers/ \ --enable-octphy \ --enable-trx \ " -./configure $configure_flags -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ - $MAKE distcheck \ - || cat-testlogs.sh + +build_bts "osmo-bts-octphy+trx" "$configure_flags" diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 6645181f..ca12e761 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -15,24 +15,10 @@ cd "$deps" osmo-layer1-headers.sh sysmo "$FIRMWARE_VERSION" mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -cd "$base" - -set +x -echo -echo -echo -echo " =============================== osmo-bts-sysmo ===============================" -echo -set -x - -autoreconf --install --force -./configure --enable-sysmocom-bts --with-openbsc="$deps/openbsc/openbsc/include" -$MAKE $PARALLEL_MAKE -$MAKE check \ - || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--enable-sysmocom-bts --with-openbsc=$deps/openbsc/openbsc/include" \ - $MAKE distcheck \ - || cat-testlogs.sh + +configure_flags="--enable-sysmocom-bts" + +build_bts "osmo-bts-sysmo" "$configure_flags" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then -- cgit v1.2.3