diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2022-08-08 13:56:22 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2022-08-08 15:47:59 +0000 |
commit | cb1468671fa752b4fd8677e18ba168d272c0256a (patch) | |
tree | 3610290888349b25498b81004d3aa40474b15c4a | |
parent | 939a28516aea819976982d935bb6401bca14f94e (diff) |
round-robin.sh: Extract baseline revs from manifests
This allows us to stop maintaining per-project git repos
in https://git.linaro.org/toolchain/ci/ for storing baselines.
Another great benefit is that we can now easily set baseline
state of CI loops by adjusting a commits in base-artifacts.git .
Change-Id: I87059653e41e2191411271e6ad4a1f30e1756935
-rw-r--r-- | round-robin.sh | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/round-robin.sh b/round-robin.sh index 04683e59..f294099b 100644 --- a/round-robin.sh +++ b/round-robin.sh @@ -161,15 +161,32 @@ clone_repo () url="${rr[${project}_git]%#*}" branch="${rr[${project}_git]#*#}" else - # Fetch and checkout from baseline repo. - url=$(print_baseline_repo "$project" true) - branch="${rr[baseline_branch]}" + # TODO: Remove transitional compatability code + local base_manifest + if [ -e base-artifacts/manifest.sh ]; then + base_manifest=base-artifacts/manifest.sh + else + base_manifest=base-artifacts/jenkins/manifest.sh + fi + url=$(source $base_manifest; echo "${rr[${project}_url]-}") + branch=$(source $base_manifest; echo "${rr[${project}_rev]-}") + + if [ x"$url" = x"" ]; then + url=$(print_baseline_repo "$project" false) + fi + + assert_with_msg "ERROR: No rr[${project}_url] in baseline manifest" \ + [ x"$url" != x"" ] + assert_with_msg "ERROR: No rr[${project}_rev] in baseline manifest" \ + [ x"$branch" != x"" ] fi + # Allow manifest override for $url + url="${rr[${project}_url-$url]-$url}" clone_or_update_repo_no_checkout "$project" "$url" auto "" origin \ > /dev/null - # Allow manifest override + # Allow manifest override for $branch branch="${rr[${project}_rev]-$branch}" git_checkout "$project" "$branch" origin @@ -179,7 +196,10 @@ clone_repo () local debug_project_date debug_project_date=$(git -C $project show --no-patch --pretty="%ct # %cr" HEAD) + # Store git url and rev info in the manifest. This is then used by + # subsequent builds to fetch baseline commits. cat <<EOF | manifest_out +rr[${project}_url]=$url rr[${project}_rev]=$cur_rev rr[debug_${project}_date]=$debug_project_date EOF @@ -845,18 +865,6 @@ $(cat ${rr[top_artifacts]}/results)" cat > ${rr[top_artifacts]}/jenkins/git-push.sh <<EOF git -C base-artifacts push --force baseline HEAD:${rr[baseline_branch]} EOF - - local url - local c - for c in $(print_updated_components); do - # Clone (but don't checkout) always-present "empty" branch of - # the baseline repo. This initializes read/write "baseline" remote. - url=$(print_baseline_repo "$c" false) - git_set_remote "$c" baseline "$url" - cat >> ${rr[top_artifacts]}/jenkins/git-push.sh <<EOF -git -C $c push --force baseline HEAD:${rr[baseline_branch]} -EOF - done chmod +x ${rr[top_artifacts]}/jenkins/git-push.sh ) } |