summary refs log tree commit diff
path: root/.buildkite
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-10-07 13:03:08 +0100
committerBrendan Abolivier <babolivier@matrix.org>2019-10-07 13:03:08 +0100
commitf38ad87384f45af3db0c6dbf071aef30a16bc81e (patch)
tree3f0b6c4d6c80c6aad04ab3ef2f65c9fa7bb3345e /.buildkite
parentChangelog (diff)
downloadsynapse-f38ad87384f45af3db0c6dbf071aef30a16bc81e.tar.xz
Use mainline's merge_base_branch.sh
Diffstat (limited to '.buildkite')
-rwxr-xr-x.buildkite/merge_base_branch.sh21
1 files changed, 10 insertions, 11 deletions
diff --git a/.buildkite/merge_base_branch.sh b/.buildkite/merge_base_branch.sh
index 3a6476a96c..2dc18c9cf6 100755
--- a/.buildkite/merge_base_branch.sh
+++ b/.buildkite/merge_base_branch.sh
@@ -1,15 +1,14 @@
 #!/usr/bin/env bash
 
-set -e
+set -ex
 
-# CircleCI doesn't give CIRCLE_PR_NUMBER in the environment for non-forked PRs. Wonderful.
-# In this case, we just need to do some ~shell magic~ to strip it out of the PULL_REQUEST URL.
-echo 'export CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}"' >> $BASH_ENV
-source $BASH_ENV
+if [[ "$BUILDKITE_BRANCH" == "dinsic" ]]; then
+    echo "Not merging forward, as this is a release branch"
+    exit 0
+fi
 
-if [[ -z "${CIRCLE_PR_NUMBER}" ]]
-then
-    echo "Can't figure out what the PR number is! Assuming merge target is dinsic."
+if [[ -z $BUILDKITE_PULL_REQUEST_BASE_BRANCH ]]; then
+     echo "Can't figure out what the PR number is! Assuming merge target is dinsic."
 
     # It probably hasn't had a PR opened yet. Since all PRs for dinsic land on
     # dinsic, we can probably assume it's based on it and will be merged into
@@ -17,7 +16,7 @@ then
     GITBASE="dinsic"
 else
     # Get the reference, using the GitHub API
-    GITBASE=`wget -O- https://api.github.com/repos/matrix-org/synapse-dinsic/pulls/${CIRCLE_PR_NUMBER} | jq -r '.base.ref'`
+    GITBASE=$BUILDKITE_PULL_REQUEST_BASE_BRANCH
 fi
 
 # Show what we are before
@@ -29,7 +28,7 @@ git config --global user.name "A robot"
 
 # Fetch and merge. If it doesn't work, it will raise due to set -e.
 git fetch -u origin $GITBASE
-git merge --no-edit origin/$GITBASE
+git merge --no-edit --no-commit origin/$GITBASE
 
 # Show what we are after.
-git --no-pager show -s
+git --no-pager show -s
\ No newline at end of file