Change in ...osmo-ci[master]: OBS: print date/time before git clone and on error

osmith gerrit-no-reply at lists.osmocom.org
Mon Jul 22 11:23:07 UTC 2019


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/14894


Change subject: OBS: print date/time before git clone and on error
......................................................................

OBS: print date/time before git clone and on error

The OBS job clones a lot of repositories from git.osmocom.org every
night, so it is a good candidate to reproduce the "garbage at end of
loose object" error we are getting sporadically.

Print exact timestamps, so we can check if there is anything related in
the server logs, when this error happens again.

Related: OS#4083
Change-Id: Ic9a6d3f0c2b8dad2661ede793c21307f1680a52e
---
M scripts/common.sh
M scripts/osmocom-latest-packages.sh
M scripts/osmocom-nightly-packages.sh
3 files changed, 15 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/94/14894/1

diff --git a/scripts/common.sh b/scripts/common.sh
index bf24fc4..6d91101 100644
--- a/scripts/common.sh
+++ b/scripts/common.sh
@@ -89,6 +89,16 @@
 	echo "$ret" | cut -d/ -f 3
 }
 
+# Pass all arguments to "git clone", but write the current date and time before the clone and on failure.
+# This helps analyzing errors with git.osmocom.org (OS#4083).
+osmo_git_clone_date() {
+	date "+%Y-%m-%d %H:%M:%S"
+	if ! git clone "$@"; then
+		date "+%Y-%m-%d %H:%M:%S"
+		exit 1
+	fi
+}
+
 # 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() {
diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh
index 1074294..509bced 100755
--- a/scripts/osmocom-latest-packages.sh
+++ b/scripts/osmocom-latest-packages.sh
@@ -1,4 +1,5 @@
 #!/bin/sh
+. "$(dirname "$0")/common.sh"
 . "$(dirname "$0")/common-obs.sh"
 
 # requirements
@@ -54,7 +55,7 @@
   if [ "$project" = "limesuite" ]; then
      [ -d "$project" ] || git clone "https://github.com/myriadrf/LimeSuite" "$project"
   else
-    [ -d "$project" ] || git clone "https://git.osmocom.org/$project"
+    [ -d "$project" ] || osmo_git_clone_date "https://git.osmocom.org/$project"
   fi
   cd "$project"
   git fetch
diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh
index 172e4e0..1c76cc1 100755
--- a/scripts/osmocom-nightly-packages.sh
+++ b/scripts/osmocom-nightly-packages.sh
@@ -1,4 +1,5 @@
 #!/bin/bash
+. "$(dirname "$0")/common.sh"
 . "$(dirname "$0")/common-obs.sh"
 
 # requirements
@@ -68,9 +69,9 @@
   cd "$REPO"
 
   if [ -n "$branch" ] ; then
-    git clone "$url/$name" -b "$branch"
+    osmo_git_clone_date "$url/$name" -b "$branch"
   else
-    git clone "$url/$name"
+    osmo_git_clone_date "$url/$name"
   fi
 
   cd -

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/14894
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ic9a6d3f0c2b8dad2661ede793c21307f1680a52e
Gerrit-Change-Number: 14894
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190722/d91f8045/attachment.html>


More information about the gerrit-log mailing list