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
This commit is contained in:
Max 2017-06-12 19:15:05 +02:00 committed by Harald Welte
parent d5971d0681
commit 5b87144f91
5 changed files with 36 additions and 69 deletions

View File

@ -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

24
contrib/jenkins_common.sh Normal file
View File

@ -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]")

View File

@ -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"

View File

@ -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

View File

@ -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"