aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-05-12 16:24:16 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-05-15 12:23:57 +0000
commit07650989469aa4b204908713ebc4d82e92fde92a (patch)
tree31b48ef3d33622f0b8507e204fc3a9bd926b08d5
parent143ab81aac471b2516cf3b2b5c0ce61a9238c083 (diff)
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
-rwxr-xr-xcontrib/jenkins-osmo-bts-octphy.sh10
-rwxr-xr-xcontrib/jenkins-osmo-bts-sysmo.sh10
-rwxr-xr-xcontrib/jenkins-osmo-bts-trx.sh10
-rwxr-xr-xcontrib/jenkins-osmo-nitb.sh11
4 files changed, 21 insertions, 20 deletions
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"
}