summaryrefslogtreecommitdiff
path: root/jenkins-helpers.sh
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-04-26 06:53:55 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-04-27 08:35:57 +0000
commit00a144341d519650f421d49a558e0edb68c6b51d (patch)
treee882206349c825c42adab010b29eca52fde2d244 /jenkins-helpers.sh
parent3fffc30738d93d39ac4c58b87ef15fe8ecdfdaf1 (diff)
jenkins-helpers.sh: Add close_baseline_repo helper
... and use it in round-robin.sh:clone_repo(). Change-Id: I6d10cc70430f1a834efb7d4b438c939aa61a6568
Diffstat (limited to 'jenkins-helpers.sh')
-rw-r--r--jenkins-helpers.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh
index 83896600..c64d1766 100644
--- a/jenkins-helpers.sh
+++ b/jenkins-helpers.sh
@@ -517,6 +517,40 @@ clone_or_update_repo ()
)
}
+# Clone or update a baseline git repo
+# $1 -- repo directory
+# $2 -- branch to checkout
+# $3 -- Whether to make the new remote read-only or read-write.
+clone_baseline_repo ()
+{
+ (
+ set -euf -o pipefail
+
+ local dir="$1"
+ local branch="$2"
+ local read_only="$3"
+
+ local repo
+ case "$dir" in
+ binutils) repo=binutils-gdb.git ;;
+ llvm) repo=llvm-project.git ;;
+ *) repo=$dir.git ;;
+ esac
+
+ # Use git-us.l.o to avoid delays between review.l.o and git.l.o
+ local url="git-us.linaro.org/toolchain/ci/$repo"
+ if $read_only; then
+ url="https://$url"
+ else
+ # Use gitolite access. Gerrit's ssh access verifies pushed commits,
+ # which can slow-down server on big pushes.
+ url="ssh://$url"
+ fi
+
+ clone_or_update_repo "$dir" "$branch" "$url" auto "$branch" baseline
+ )
+}
+
# Wget files from URL that may have wildcards; only the last "basename"
# part of URL is allowed to contain wildcards. Safe to use on normal URLs.
# Return N-1 of files downloaded, or 127 if no files were downloaded.