From 07650989469aa4b204908713ebc4d82e92fde92a Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 12 May 2017 16:24:16 +0200 Subject: checkout dependencies from script The jenkins jobs used to have multiple source repositories configured, but it is really cumbersome to add all the SCM links to a jenkins job. Instead, clone the git sources from the script, as we also do in various other contrib/ scripts. This partly duplicates the osmo-ci scripts, but since this code is much more intended to run on other peoples' jenkins instances, rather keep the osmo-ci dependency out of here. Change-Id: Ie05cb9cd2bd884f72cbdbcc96d9c4389ffca7357 --- contrib/jenkins-osmo-bts-octphy.sh | 10 +++++----- contrib/jenkins-osmo-bts-sysmo.sh | 10 +++++----- contrib/jenkins-osmo-bts-trx.sh | 10 +++++----- contrib/jenkins-osmo-nitb.sh | 11 ++++++----- 4 files changed, 21 insertions(+), 20 deletions(-) (limited to 'contrib') diff --git a/contrib/jenkins-osmo-bts-octphy.sh b/contrib/jenkins-osmo-bts-octphy.sh index 49560ca..a4a57e4 100755 --- a/contrib/jenkins-osmo-bts-octphy.sh +++ b/contrib/jenkins-osmo-bts-octphy.sh @@ -15,14 +15,14 @@ osmo-bts have_repo() { repo="$1" cd "$base" - if [ ! -e "$repo" ]; then - set +x - echo "MISSING REPOSITORY: $repo" - echo "should be provided by the jenkins workspace" - exit 1 + if [ ! -d "$repo" ]; then + git clone "git://git.osmocom.org/$repo" "$repo" fi cd "$repo" git clean -dxf + git fetch origin + git reset --hard origin/master + git rev-parse HEAD cd "$base" } diff --git a/contrib/jenkins-osmo-bts-sysmo.sh b/contrib/jenkins-osmo-bts-sysmo.sh index 52f7593..5e6c9d9 100755 --- a/contrib/jenkins-osmo-bts-sysmo.sh +++ b/contrib/jenkins-osmo-bts-sysmo.sh @@ -13,14 +13,14 @@ rm -f "$base/osmo-bts-sysmo.*.tgz" have_repo() { repo="$1" cd "$base" - if [ ! -e "$repo" ]; then - set +x - echo "MISSING REPOSITORY: $repo" - echo "should be provided by the jenkins workspace" - exit 1 + if [ ! -d "$repo" ]; then + git clone "git://git.osmocom.org/$repo" "$repo" fi cd "$repo" git clean -dxf + git fetch origin + git reset --hard origin/master + git rev-parse HEAD cd "$base" } diff --git a/contrib/jenkins-osmo-bts-trx.sh b/contrib/jenkins-osmo-bts-trx.sh index e44cf0a..fb49a75 100755 --- a/contrib/jenkins-osmo-bts-trx.sh +++ b/contrib/jenkins-osmo-bts-trx.sh @@ -16,14 +16,14 @@ osmo-bts have_repo() { repo="$1" cd "$base" - if [ ! -e "$repo" ]; then - set +x - echo "MISSING REPOSITORY: $repo" - echo "should be provided by the jenkins workspace" - exit 1 + if [ ! -d "$repo" ]; then + git clone "git://git.osmocom.org/$repo" "$repo" fi cd "$repo" git clean -dxf + git fetch origin + git reset --hard origin/master + git rev-parse HEAD cd "$base" } diff --git a/contrib/jenkins-osmo-nitb.sh b/contrib/jenkins-osmo-nitb.sh index 05d2041..61d6e2f 100755 --- a/contrib/jenkins-osmo-nitb.sh +++ b/contrib/jenkins-osmo-nitb.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -e -x base="$PWD" @@ -18,14 +19,14 @@ openbsc have_repo() { repo="$1" cd "$base" - if [ ! -e "$repo" ]; then - set +x - echo "MISSING REPOSITORY: $repo" - echo "should be provided by the jenkins workspace" - exit 1 + if [ ! -d "$repo" ]; then + git clone "git://git.osmocom.org/$repo" "$repo" fi cd "$repo" git clean -dxf + git fetch origin + git reset --hard origin/master + git rev-parse HEAD cd "$base" } -- cgit v1.2.3