From 7887ce7aeaf5d5fa5c1ac29341fa67814921dccc Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 10 Jul 2017 14:54:24 +0200 Subject: [PATCH] jenkins helpers: some minimal documentation/comments + print errors We should print meaningful error messages in case a user doesn't have the required local PATH set up, or doesn't specify a required command line argument. Change-Id: I30a2935f93ade69222b1e0c3e212ee10e17c1823 --- contrib/jenkins_bts_model.sh | 8 ++++++++ contrib/jenkins_bts_trx.sh | 1 + contrib/jenkins_common.sh | 9 +++++++++ contrib/jenkins_lc15.sh | 1 + contrib/jenkins_oct.sh | 1 + contrib/jenkins_oct_and_bts_trx.sh | 1 + contrib/jenkins_sysmobts.sh | 1 + 7 files changed, 22 insertions(+) diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh index c44daa7e7..33bfdc7c5 100755 --- a/contrib/jenkins_bts_model.sh +++ b/contrib/jenkins_bts_model.sh @@ -1,6 +1,14 @@ #!/bin/sh +# this is a dispatcher script which will call the bts-model-specific +# script based on the bts model specified as command line argument + bts_model="$1" +if [ "x$bts_model" == "x" ]; then + echo "Error: You have to specify the BTS model as first argument, e.g. $0 sysmo" + exit 2 +fi + if [ ! -d "./contrib" ]; then echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree" exit 1 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 076a4fffd..9e958097b 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -1,4 +1,5 @@ #!/bin/sh +# jenkins build helper script for osmo-bts-trx # shellcheck source=contrib/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index 824dd43a9..bce771d85 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -1,5 +1,14 @@ #!/bin/sh +# this is a common helper script that is shared among all BTS model +# specific helper scripts like jenkins_sysmobts.sh. You shouldn't call +# this directly, but rather indirectly via the bts-specific scripts + +if ! [ -x "$(command -v osmo-deps.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -ex base="$PWD" diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index af335d517..a2d95149d 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -1,4 +1,5 @@ #!/bin/sh +# jenkins build helper script for osmo-bts-lc15 # shellcheck source=contrib/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 6ad535866..b3dc07fdf 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -1,4 +1,5 @@ #!/bin/sh +# jenkins build helper script for osmo-bts-octphy # shellcheck source=contrib/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index a8a8004b7..c23009d15 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -1,4 +1,5 @@ #!/bin/sh +# jenkins build helper script for osmo-bts-octphy + osmo-bts-trx # shellcheck source=contrib/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 227f249a3..6645181f9 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -1,4 +1,5 @@ #!/bin/sh +# jenkins build helper script for osmo-bts-sysmo # shellcheck source=contrib/jenkins_common.sh . $(dirname "$0")/jenkins_common.sh