mirror of https://gerrit.osmocom.org/osmo-ci
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:
parent
aadc60f403
commit
d93fd48da9
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Various functions and variables used in multiple osmo-ci shell scripts
|
# Various functions and variables used in multiple osmo-ci shell scripts
|
||||||
OSMO_GIT_URL="https://git.osmocom.org"
|
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
|
# 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
|
# https://jenkins.osmocom.org/jenkins/job/Osmocom-list-commits/lastSuccessfulBuild/artifact/commits.txt
|
||||||
|
@ -99,6 +100,20 @@ osmo_git_clone_date() {
|
||||||
fi
|
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 the subdirectory of the repository where the source lies (configure.ac etc.).
|
||||||
# Print nothing when the source is in the topdir of the repository.
|
# Print nothing when the source is in the topdir of the repository.
|
||||||
osmo_source_subdir() {
|
osmo_source_subdir() {
|
||||||
|
|
|
@ -55,7 +55,7 @@ checkout() {
|
||||||
if [ "$project" = "limesuite" ]; then
|
if [ "$project" = "limesuite" ]; then
|
||||||
[ -d "$project" ] || git clone "https://github.com/myriadrf/LimeSuite" "$project"
|
[ -d "$project" ] || git clone "https://github.com/myriadrf/LimeSuite" "$project"
|
||||||
else
|
else
|
||||||
[ -d "$project" ] || osmo_git_clone_date "https://git.osmocom.org/$project"
|
[ -d "$project" ] || osmo_git_clone_date "$(osmo_git_clone_url "$project")"
|
||||||
fi
|
fi
|
||||||
cd "$project"
|
cd "$project"
|
||||||
git fetch
|
git fetch
|
||||||
|
@ -131,6 +131,7 @@ build() {
|
||||||
build_osmocom() {
|
build_osmocom() {
|
||||||
prepare
|
prepare
|
||||||
|
|
||||||
|
# NOTE: when adding a repository that is not in gerrit, adjust osmo_git_clone_url()
|
||||||
checkout limesuite
|
checkout limesuite
|
||||||
checkout osmo-gsm-manuals
|
checkout osmo-gsm-manuals
|
||||||
checkout libosmocore
|
checkout libosmocore
|
||||||
|
|
|
@ -64,14 +64,13 @@ get_commit_version() {
|
||||||
checkout() {
|
checkout() {
|
||||||
local name=$1
|
local name=$1
|
||||||
local branch=$2
|
local branch=$2
|
||||||
local url="https://git.osmocom.org"
|
|
||||||
|
|
||||||
cd "$REPO"
|
cd "$REPO"
|
||||||
|
|
||||||
if [ -n "$branch" ] ; then
|
if [ -n "$branch" ] ; then
|
||||||
osmo_git_clone_date "$url/$name" -b "$branch"
|
osmo_git_clone_date "$(osmo_git_clone_url "$name")" -b "$branch"
|
||||||
else
|
else
|
||||||
osmo_git_clone_date "$url/$name"
|
osmo_git_clone_date "$(osmo_git_clone_url "$name")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd -
|
cd -
|
||||||
|
@ -177,6 +176,7 @@ build_osmocom() {
|
||||||
|
|
||||||
prepare
|
prepare
|
||||||
|
|
||||||
|
# NOTE: when adding a repository that is not in gerrit, adjust osmo_git_clone_url()
|
||||||
checkout_limesuite
|
checkout_limesuite
|
||||||
checkout osmo-gsm-manuals
|
checkout osmo-gsm-manuals
|
||||||
checkout libosmocore
|
checkout libosmocore
|
||||||
|
|
Loading…
Reference in New Issue