diff --git a/.buildkite/scripts/lucene-snapshot/update-branch.sh b/.buildkite/scripts/lucene-snapshot/update-branch.sh index 6a2d1e3df05f7..a2a80824c984f 100755 --- a/.buildkite/scripts/lucene-snapshot/update-branch.sh +++ b/.buildkite/scripts/lucene-snapshot/update-branch.sh @@ -7,12 +7,21 @@ if [[ "$BUILDKITE_BRANCH" != "lucene_snapshot"* ]]; then exit 1 fi -echo --- Updating "$BUILDKITE_BRANCH" branch with main +if [[ "$BUILDKITE_BRANCH" == "lucene_snapshot_10" ]]; then + UPSTREAM="main" +elif [[ "$BUILDKITE_BRANCH" == "lucene_snapshot" ]]; then + UPSTREAM="8.x" +else + echo "Error: unknown branch: $BUILDKITE_BRANCH" + exit 1 +fi + +echo --- Updating "$BUILDKITE_BRANCH" branch with "$UPSTREAM" git config --global user.name elasticsearchmachine git config --global user.email 'infra-root+elasticsearchmachine@elastic.co' git checkout "$BUILDKITE_BRANCH" -git fetch origin main -git merge --no-edit origin/main +git fetch origin "$UPSTREAM" +git merge --no-edit "origin/$UPSTREAM" git push origin "$BUILDKITE_BRANCH"