aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-06-12 19:15:05 +0200
committerHarald Welte <laforge@gnumonks.org>2017-06-21 20:25:27 +0000
commit5b87144f91f86310073d6652c12fa717746ed8ba (patch)
tree08f6cd23cd130aef062a00f7e82d8ea73d2c4e61
parentd5971d0681d5e9fb27c1c2c97e943f9d9e8cb2f8 (diff)
Move common steps into common jenkins helper
Move value_string termination check and OpenBSC headers checkout into shared jenkins helper from BTS' model-specific helpers to get rid of copy-pasted code. While at it - also remove unnecessary bash dependency. Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408
-rwxr-xr-xcontrib/jenkins_bts_trx.sh18
-rw-r--r--contrib/jenkins_common.sh24
-rwxr-xr-xcontrib/jenkins_oct.sh22
-rwxr-xr-xcontrib/jenkins_oct_and_bts_trx.sh19
-rwxr-xr-xcontrib/jenkins_sysmobts.sh22
5 files changed, 36 insertions, 69 deletions
diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh
index dbd41ca..076a4ff 100755
--- a/contrib/jenkins_bts_trx.sh
+++ b/contrib/jenkins_bts_trx.sh
@@ -1,22 +1,13 @@
-#!/usr/bin/env bash
+#!/bin/sh
-set -ex
-
-base="$PWD"
-deps="$base/deps"
-inst="$deps/install"
-export deps inst
-
-mkdir "$deps" || true
-rm -rf "$inst"
+# shellcheck source=contrib/jenkins_common.sh
+. $(dirname "$0")/jenkins_common.sh
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmocore
-"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
-
osmo-build-dep.sh libosmo-abis
cd "$deps"
@@ -24,9 +15,6 @@ cd "$deps"
# Get osmo-pcu for pcuif_proto.h
osmo-deps.sh osmo-pcu
-# Get openbsc for gsm_data_shared.*
-osmo-deps.sh openbsc
-
cd "$base"
set +x
diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh
new file mode 100644
index 0000000..824dd43
--- /dev/null
+++ b/contrib/jenkins_common.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -ex
+
+base="$PWD"
+deps="$base/deps"
+inst="$deps/install"
+
+export deps inst
+
+mkdir -p "$deps"
+rm -rf "$inst"
+
+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]")
diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh
index 9f06888..0f926c9 100755
--- a/contrib/jenkins_oct.sh
+++ b/contrib/jenkins_oct.sh
@@ -1,26 +1,10 @@
-#!/usr/bin/env bash
+#!/bin/sh
-set -ex
-
-base="$PWD"
-deps="$base/deps"
-inst="$deps/install"
-export deps inst
-
-mkdir "$deps" || true
-rm -rf "$inst"
-
-# Get the headers..
-cd "$deps"
-git clone git://git.osmocom.org/openbsc || true
-cd openbsc
-git pull --rebase
-cd "$base"
+# shellcheck source=contrib/jenkins_common.sh
+. $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore
-"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
-
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh
index 93aa47a..132c2e0 100755
--- a/contrib/jenkins_oct_and_bts_trx.sh
+++ b/contrib/jenkins_oct_and_bts_trx.sh
@@ -1,22 +1,13 @@
-#!/usr/bin/env bash
+#!/bin/sh
-set -ex
-
-base="$PWD"
-deps="$base/deps"
-inst="$deps/install"
-export deps inst
-
-mkdir "$deps" || true
-rm -rf "$inst"
+# shellcheck source=contrib/jenkins_common.sh
+. $(dirname "$0")/jenkins_common.sh
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmocore
-"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
-
osmo-build-dep.sh libosmo-abis
cd "$deps"
@@ -24,10 +15,6 @@ cd "$deps"
# Get osmo-pcu for pcuif_proto.h
osmo-deps.sh osmo-pcu
-# Get openbsc for gsm_data_shared.*
-osmo-deps.sh openbsc
-
-cd "$deps"
if ! test -d layer1-api;
then
git clone git://git.osmocom.org/octphy-2g-headers layer1-api
diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh
index c6f109d..bce0690 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -1,26 +1,10 @@
-#!/usr/bin/env bash
+#!/bin/sh
-set -ex
-
-base="$PWD"
-deps="$base/deps"
-inst="$deps/install"
-export deps inst
-
-mkdir "$deps" || true
-rm -rf "$inst"
-
-# Get the headers..
-cd "$deps"
-git clone git://git.osmocom.org/openbsc || true
-cd openbsc
-git pull --rebase
-cd "$base"
+# shellcheck source=contrib/jenkins_common.sh
+. $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore
-"$deps"/libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
-
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"