OBS: clone from gerrit.osmocom.org

Work around "garbage at end of loose object" errors that occasionally
cause these jenkins jobs to fail.

A few repositories are not hosted on gerrit, so they still get cloned
from git.osmocom.org. However, having almost all repositories cloned from
gerrit should improve the situation a lot.

Related: OS#4083
Change-Id: Id8f08a1bc10d6c81be9ad44c60646e2ea9f6cf4e
This commit is contained in:
Oliver Smith 2019-12-12 13:15:43 +01:00 committed by osmith
parent aadc60f403
commit d93fd48da9
3 changed files with 20 additions and 4 deletions

View File

@ -1,6 +1,7 @@
#!/bin/sh
# Various functions and variables used in multiple osmo-ci shell scripts
OSMO_GIT_URL="https://git.osmocom.org"
OSMO_GIT_URL_GERRIT="https://gerrit.osmocom.org"
# Osmocom repositories of which we want to build release tarballs automatically, and list the current versions at
# https://jenkins.osmocom.org/jenkins/job/Osmocom-list-commits/lastSuccessfulBuild/artifact/commits.txt
@ -99,6 +100,20 @@ osmo_git_clone_date() {
fi
}
# Print git clone URL for an Osmocom git repository. Prefer the gerrit clone URL, because cloning from the regular URL
# sometimes results in the "garbage at end of loose object" error (OS#4083).
# $1: Osmocom project (e.g. "osmo-hlr")
osmo_git_clone_url() {
case "$1" in
rtl-sdr|osmo-fl2k|libosmo-dsp|libgtpnl|libasn1c|libusrp|libsmpp34)
echo "$OSMO_GIT_URL"/"$1"
;;
*)
echo "$OSMO_GIT_URL_GERRIT"/"$1"
;;
esac
}
# Print the subdirectory of the repository where the source lies (configure.ac etc.).
# Print nothing when the source is in the topdir of the repository.
osmo_source_subdir() {

View File

@ -55,7 +55,7 @@ checkout() {
if [ "$project" = "limesuite" ]; then
[ -d "$project" ] || git clone "https://github.com/myriadrf/LimeSuite" "$project"
else
[ -d "$project" ] || osmo_git_clone_date "https://git.osmocom.org/$project"
[ -d "$project" ] || osmo_git_clone_date "$(osmo_git_clone_url "$project")"
fi
cd "$project"
git fetch
@ -131,6 +131,7 @@ build() {
build_osmocom() {
prepare
# NOTE: when adding a repository that is not in gerrit, adjust osmo_git_clone_url()
checkout limesuite
checkout osmo-gsm-manuals
checkout libosmocore

View File

@ -64,14 +64,13 @@ get_commit_version() {
checkout() {
local name=$1
local branch=$2
local url="https://git.osmocom.org"
cd "$REPO"
if [ -n "$branch" ] ; then
osmo_git_clone_date "$url/$name" -b "$branch"
osmo_git_clone_date "$(osmo_git_clone_url "$name")" -b "$branch"
else
osmo_git_clone_date "$url/$name"
osmo_git_clone_date "$(osmo_git_clone_url "$name")"
fi
cd -
@ -177,6 +176,7 @@ build_osmocom() {
prepare
# NOTE: when adding a repository that is not in gerrit, adjust osmo_git_clone_url()
checkout_limesuite
checkout osmo-gsm-manuals
checkout libosmocore