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
This commit is contained in:
Neels Hofmeyr 2017-05-12 16:24:16 +02:00 committed by Neels Hofmeyr
parent 143ab81aac
commit 0765098946
4 changed files with 21 additions and 20 deletions

View File

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

View File

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

View File

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

View File

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