diff --git a/dev/release/01-prepare.sh b/dev/release/01-prepare.sh index b1e917390b4..c7f40924d40 100755 --- a/dev/release/01-prepare.sh +++ b/dev/release/01-prepare.sh @@ -54,11 +54,12 @@ fi if [ ${PREPARE_BRANCH} -gt 0 ]; then if [[ $(git branch -l "${release_candidate_branch}") ]]; then next_rc_number=$(($rc_number+1)) + source "${SOURCE_DIR}/git-vars.sh" echo "Branch ${release_candidate_branch} already exists, so create a new release candidate:" - echo "1. Checkout the master branch for major releases and maint- for patch releases." + echo "1. Checkout the default branch for major releases and maint- for patch releases." echo "2. Execute the script again with bumped RC number." echo "Commands:" - echo " git checkout master" + echo " git checkout ${DEFAULT_BRANCH}" echo " dev/release/01-prepare.sh ${version} ${next_version} ${next_rc_number}" exit 1 fi diff --git a/dev/release/git-vars.sh b/dev/release/git-vars.sh new file mode 100644 index 00000000000..7fe3255f0be --- /dev/null +++ b/dev/release/git-vars.sh @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +DEFAULT_BRANCH="$(git rev-parse --abbrev-ref origin/HEAD | sed s@origin/@@)" \ No newline at end of file diff --git a/dev/release/post-04-website.sh b/dev/release/post-04-website.sh index 772a54d8c3d..d8a9df42493 100755 --- a/dev/release/post-04-website.sh +++ b/dev/release/post-04-website.sh @@ -38,9 +38,10 @@ announce_file="${release_dir}/${version}.md" versions_yml="${ARROW_SITE_DIR}/_data/versions.yml" pushd "${ARROW_SITE_DIR}" +source "${SOURCE_DIR}/git-vars.sh" git fetch --all --prune --tags --force -j$(nproc) -git checkout master -git rebase apache/master +git checkout ${DEFAULT_BRANCH} +git rebase apache/${DEFAULT_BRANCH} git branch -D ${branch_name} || : git checkout -b ${branch_name} popd diff --git a/dev/release/post-09-docs.sh b/dev/release/post-09-docs.sh index 6099248f096..cc0edc06ac2 100755 --- a/dev/release/post-09-docs.sh +++ b/dev/release/post-09-docs.sh @@ -34,9 +34,10 @@ release_tag="apache-arrow-${version}" branch_name=release-docs-${version} pushd "${ARROW_SITE_DIR}" +source "${SOURCE_DIR}/git-vars.sh" git fetch --all --prune --tags --force -j$(nproc) git checkout . -git checkout master +git checkout ${DEFAULT_BRANCH} git clean -d -f -x git branch -D asf-site || : git checkout -b asf-site origin/asf-site diff --git a/dev/release/post-12-bump-versions.sh b/dev/release/post-12-bump-versions.sh index 5a626b3592a..53b3d5a7dd1 100755 --- a/dev/release/post-12-bump-versions.sh +++ b/dev/release/post-12-bump-versions.sh @@ -20,6 +20,7 @@ set -ue SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "${SOURCE_DIR}/git-vars.sh" if [ "$#" -ne 2 ]; then echo "Usage: $0 " @@ -27,7 +28,7 @@ if [ "$#" -ne 2 ]; then fi : ${BUMP_DEFAULT:=1} -: ${BUMP_UPDATE_LOCAL_MASTER:=${BUMP_DEFAULT}} +: ${BUMP_UPDATE_LOCAL_DEFAULT_BRANCH:=${BUMP_DEFAULT}} : ${BUMP_VERSION_POST_TAG:=${BUMP_DEFAULT}} : ${BUMP_DEB_PACKAGE_NAMES:=${BUMP_DEFAULT}} : ${BUMP_LINUX_PACKAGES:=${BUMP_DEFAULT}} @@ -40,11 +41,11 @@ version=$1 next_version=$2 next_version_snapshot="${next_version}-SNAPSHOT" -if [ ${BUMP_UPDATE_LOCAL_MASTER} -gt 0 ]; then - echo "Updating local master" +if [ ${BUMP_UPDATE_LOCAL_DEFAULT_BRANCH} -gt 0 ]; then + echo "Updating local default branch" git fetch --all --prune --tags --force -j$(nproc) - git checkout master - git rebase apache/master + git checkout ${DEFAULT_BRANCH} + git rebase apache/${DEFAULT_BRANCH} fi if [ ${BUMP_VERSION_POST_TAG} -gt 0 ]; then @@ -102,13 +103,13 @@ if [ ${BUMP_LINUX_PACKAGES} -gt 0 ]; then fi if [ ${BUMP_PUSH} -gt 0 ]; then - echo "Pushing changes to the master in apache/arrow" - git push apache master + echo "Pushing changes to the default branch in apache/arrow" + git push apache ${DEFAULT_BRANCH} fi if [ ${BUMP_TAG} -gt 0 ]; then dev_tag=apache-arrow-${next_version}.dev echo "Tagging ${dev_tag}" - git tag ${dev_tag} master + git tag ${dev_tag} ${DEFAULT_BRANCH} git push apache ${dev_tag} fi