From 5b87144f91f86310073d6652c12fa717746ed8ba Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 12 Jun 2017 19:15:05 +0200 Subject: 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 --- contrib/jenkins_bts_trx.sh | 18 +++--------------- contrib/jenkins_common.sh | 24 ++++++++++++++++++++++++ contrib/jenkins_oct.sh | 22 +++------------------- contrib/jenkins_oct_and_bts_trx.sh | 19 +++---------------- contrib/jenkins_sysmobts.sh | 22 +++------------------- 5 files changed, 36 insertions(+), 69 deletions(-) create mode 100644 contrib/jenkins_common.sh (limited to 'contrib') diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index dbd41ca9..076a4fff 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 00000000..824dd43a --- /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 9f06888d..0f926c96 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 93aa47a1..132c2e0d 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 c6f109de..bce06903 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" -- cgit v1.2.3