Review at https://gerrit.osmocom.org/3008
Simplify jenkins build scripts
* move duplicated code into separate functions in jenkins_common.sh
* use that function in individual builds
Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf
---
M contrib/jenkins_bts_trx.sh
M contrib/jenkins_common.sh
M contrib/jenkins_lc15.sh
M contrib/jenkins_oct_and_bts_trx.sh
M contrib/jenkins_sysmobts.sh
5 files changed, 26 insertions(+), 60 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/08/3008/1
diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh
index 076a4ff..664c158 100755
--- a/contrib/jenkins_bts_trx.sh
+++ b/contrib/jenkins_bts_trx.sh
@@ -17,24 +17,10 @@
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 "osmo-bts-trx" $configure_flags
diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh
index 824dd43..d81817d 100644
--- a/contrib/jenkins_common.sh
+++ b/contrib/jenkins_common.sh
@@ -22,3 +22,21 @@
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() {
+ set +x
+ echo
+ echo "$2"
+ echo
+ echo " =============================== $1 ==============================="
+ echo
+ set -x
+
+ autoreconf --install --force
+ ./configure "$2 --with-openbsc=$deps/openbsc/openbsc/include"
+ $MAKE $PARALLEL_MAKE
+ $MAKE check || cat-testlogs.sh
+ DISTCHECK_CONFIGURE_FLAGS="$2
--with-openbsc=$deps/openbsc/openbsc/include" $MAKE distcheck || cat-testlogs.sh
+}
diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh
index af335d5..420d8d2 100755
--- a/contrib/jenkins_lc15.sh
+++ b/contrib/jenkins_lc15.sh
@@ -14,16 +14,6 @@
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 "osmo-bts-lc15" $configure_flags
diff --git a/contrib/jenkins_oct_and_bts_trx.sh
b/contrib/jenkins_oct_and_bts_trx.sh
index a8a8004..74aa7e3 100755
--- a/contrib/jenkins_oct_and_bts_trx.sh
+++ b/contrib/jenkins_oct_and_bts_trx.sh
@@ -19,15 +19,6 @@
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 \
@@ -35,10 +26,5 @@
--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 "osmo-bts-octphy+trx" $configure_flags
diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh
index 227f249..7cd8572 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -16,22 +16,8 @@
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 "osmo-bts-sysmo" $configure_flags
# This will not work for the femtobts
if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then
--
To view, visit https://gerrit.osmocom.org/3008
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <[email protected]>