You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by si...@apache.org on 2018/06/14 18:01:21 UTC

[bookkeeper] 01/02: ISSUE #1246: Scripting the whole release procedure

This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch branch-4.7
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit f603fdbbc9091873991c0c1ec7b1e19be4040fe3
Author: Sijie Guo <si...@apache.org>
AuthorDate: Thu Apr 19 00:09:12 2018 -0700

    ISSUE #1246: Scripting the whole release procedure
    
    Descriptions of the changes in this PR:
    
    *Motivation*
    
    Releasing bookkeeper becomes tricky after introducing `circe-checksum`, since we need to ensure linux jni library is shipped as part of `circe-checksum`.
    
    *Solution*
    
    - switch to use docker for generating bookkeeper release
    - scripting the whole release procedure as many as possible
    
    Master Issue: #1246
    
    Author: Sijie Guo <si...@apache.org>
    
    Reviewers: Enrico Olivelli <eo...@gmail.com>, Jia Zhai <None>
    
    This closes #1329 from sijie/release_scripts, closes #1246
---
 dev/release/000-run-docker.sh      | 122 +++++++++++++++++++++++
 dev/release/001-release-branch.sh  |  27 ++++++
 dev/release/002-release-prepare.sh |  31 ++++++
 dev/release/003-release-perform.sh |  28 ++++++
 dev/release/004-stage-packages.sh  |  63 ++++++++++++
 dev/release/Dockerfile             |  23 +++++
 site/community/release_guide.md    | 193 ++++++++++++++++---------------------
 7 files changed, 378 insertions(+), 109 deletions(-)

diff --git a/dev/release/000-run-docker.sh b/dev/release/000-run-docker.sh
new file mode 100755
index 0000000..5ec4c46
--- /dev/null
+++ b/dev/release/000-run-docker.sh
@@ -0,0 +1,122 @@
+#!/bin/bash
+
+# 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.
+
+if [ $# = 0 ]; then
+    cat <<EOF
+Usage: ./dev/release/000-run-docker.sh <RC_NUM>
+EOF
+    exit 1;
+fi
+
+set -e -x -u
+
+RC_NUM=$(($1 + 0)) 
+shift
+
+SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+
+export IMAGE_NAME="bookkeeper-release-build"
+
+pushd ${SCRIPT_DIR}
+
+docker build --rm=true -t ${IMAGE_NAME} .
+
+popd
+
+if [ "$(uname -s)" == "Linux" ]; then
+  USER_NAME=${SUDO_USER:=$USER}
+  USER_ID=$(id -u "${USER_NAME}")
+  GROUP_ID=$(id -g "${USER_NAME}")
+  LOCAL_HOME="/home/${USER_NAME}"
+else # boot2docker uid and gid
+  USER_NAME=$USER
+  USER_ID=1000
+  GROUP_ID=50
+  LOCAL_HOME="/Users/${USER_NAME}"
+fi
+
+docker build -t "${IMAGE_NAME}-${USER_NAME}" - <<UserSpecificDocker
+FROM ${IMAGE_NAME}
+RUN groupadd --non-unique -g ${GROUP_ID} ${USER_NAME} && \
+  useradd -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME}
+ENV  HOME /home/${USER_NAME}
+UserSpecificDocker
+
+BOOKKEEPER_ROOT=${SCRIPT_DIR}/../..
+
+VERSION=`cd $BOOKKEEPER_ROOT && mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '(^\[|Download\w+:)' | sed 's/^\(.*\)-SNAPSHOT/\1/'`
+versions_list=(`echo $VERSION | tr '.' ' '`)
+major_version=${versions_list[0]}
+minor_version=${versions_list[1]}
+patch_version=${versions_list[2]}
+next_minor_version=$((minor_version + 1))
+MAJOR_VERSION="${major_version}.${minor_version}"
+NEXT_VERSION="${major_version}.${next_minor_version}.0"
+BRANCH_NAME="branch-${MAJOR_VERSION}"
+DEVELOPMENT_VERSION="${NEXT_VERSION}-SNAPSHOT"
+
+TAG="release-${VERSION}"
+RC_DIR="bookkeeper-${VERSION}-rc${RC_NUM}"
+
+CMD="
+gpg-agent --daemon --pinentry-program /usr/bin/pinentry --homedir \$HOME/.gnupg --use-standard-socket
+echo
+echo 'Welcome to Apache BookKeeper Release Build Env'
+echo
+echo 'Release $VERSION - RC$RC_NUM'
+echo
+echo 'Release Environment Variables:'
+echo
+echo 'VERSION                   = $VERSION'
+echo 'MAJOR_VERSION             = $MAJOR_VERSION'
+echo 'NEXT_VERSION              = $NEXT_VERSION'
+echo 'DEVELOPMENT_VERSION       = $DEVELOPMENT_VERSION'
+echo 'BRANCH_NAME               = $BRANCH_NAME'
+echo 'TAG                       = $TAG'
+echo 'RC_NUM                    = $RC_NUM'
+echo 'RC_DIR                    = $RC_DIR'
+echo
+echo 'Before executing any release scripts, PLEASE configure your git to cache your github password:'
+echo
+echo ' // configure credential helper to cache your github password for 1 hr during the whole release process '
+echo ' \$ git config --global credential.helper \"cache --timeout=3600\" '
+echo ' \$ git push apache --dry-run '
+echo
+bash
+"
+
+pushd ${BOOKKEEPER_ROOT}
+
+docker run -i -t \
+  --rm=true \
+  -w ${BOOKKEEPER_ROOT} \
+  -u "${USER}" \
+  -v "${BOOKKEEPER_ROOT}:${BOOKKEEPER_ROOT}" \
+  -v "${LOCAL_HOME}:/home/${USER_NAME}" \
+  -e VERSION=${VERSION} \
+  -e MAJOR_VERSION=${MAJOR_VERSION} \
+  -e NEXT_VERSION=${NEXT_VERSION} \
+  -e BRANCH_NAME=${BRANCH_NAME} \
+  -e DEVELOPMENT_VERSION=${DEVELOPMENT_VERSION} \
+  -e RC_NUM=${RC_NUM} \
+  -e TAG=${TAG} \
+  -e RC_DIR=${RC_DIR} \
+  ${IMAGE_NAME}-${USER_NAME} \
+  bash -c "${CMD}"
+
+popd
+
diff --git a/dev/release/001-release-branch.sh b/dev/release/001-release-branch.sh
new file mode 100755
index 0000000..0bff4aa
--- /dev/null
+++ b/dev/release/001-release-branch.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# 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.
+
+set -e -x -u
+
+BINDIR=`dirname "$0"`
+BK_HOME=`cd $BINDIR/../..;pwd`
+
+cd $BK_HOME
+
+mvn release:branch \
+    -DbranchName=${BRANCH_NAME} \
+    -DdevelopmentVersion=${DEVELOPMENT_VERSION}
diff --git a/dev/release/002-release-prepare.sh b/dev/release/002-release-prepare.sh
new file mode 100755
index 0000000..ed684ad
--- /dev/null
+++ b/dev/release/002-release-prepare.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# 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.
+
+set -e -x -u
+
+BINDIR=`dirname "$0"`
+BK_HOME=`cd $BINDIR/../..;pwd`
+
+cd $BK_HOME
+
+mvn release:prepare \
+    -DreleaseVersion=${VERSION} \
+    -Dtag=${TAG} \
+    -DupdateWorkingCopyVersions=false \
+    -Darguments="-Dmaven.javadoc.skip=true -DskipTests=true -Dstream" \
+    -Dstream \
+    -Dresume=true 
diff --git a/dev/release/003-release-perform.sh b/dev/release/003-release-perform.sh
new file mode 100755
index 0000000..2a5b531
--- /dev/null
+++ b/dev/release/003-release-perform.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# 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.
+
+set -e -x -u
+
+BINDIR=`dirname "$0"`
+BK_HOME=`cd $BINDIR/../..;pwd`
+
+cd $BK_HOME
+
+mvn release:perform \
+    -Darguments="-Dmaven.javadoc.skip=true -DskipTests=true -Dstream" \
+    -Dstream \
+    -Dresume=true
diff --git a/dev/release/004-stage-packages.sh b/dev/release/004-stage-packages.sh
new file mode 100755
index 0000000..8926ccf
--- /dev/null
+++ b/dev/release/004-stage-packages.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+# 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.
+
+set -e -x -u
+
+BINDIR=`dirname "$0"`
+BK_HOME=`cd $BINDIR/../..;pwd`
+
+DIST_DEV_DIR="${BK_HOME}/target/dist_dev"
+
+if [ -f ${BK_HOME}/target/dist_dev ]; then
+    rm -r ${BK_HOME}/target/dist_dev 
+fi
+
+mkdir -p $DIST_DEV_DIR
+cd $DIST_DEV_DIR
+
+echo "Cloning dist/dev repo ..."
+svn co https://dist.apache.org/repos/dist/dev/bookkeeper
+
+SRC_DIR="${BK_HOME}/target/checkout" 
+DEST_DIR="${DIST_DEV_DIR}/bookkeeper/${RC_DIR}"
+echo "Create release directory ${RC_DIR} ..."
+mkdir -p $DEST_DIR
+
+
+echo "Generating asc files ..."
+# bookkeeper-all doesn't generate `asc` file
+gpg -ab ${SRC_DIR}/bookkeeper-dist/all/target/bookkeeper-all-${VERSION}-bin.tar.gz
+echo "Generated asc files."
+
+echo "Copying packages ..."
+cp ${SRC_DIR}/bookkeeper-dist/target/bookkeeper-${VERSION}-src.tar.gz                   ${DEST_DIR}/bookkeeper-${VERSION}-src.tar.gz
+cp ${SRC_DIR}/bookkeeper-dist/target/bookkeeper-${VERSION}-src.tar.gz.asc               ${DEST_DIR}/bookkeeper-${VERSION}-src.tar.gz.asc
+cp ${SRC_DIR}/bookkeeper-dist/server/target/bookkeeper-server-${VERSION}-bin.tar.gz     ${DEST_DIR}/bookkeeper-server-${VERSION}-bin.tar.gz
+cp ${SRC_DIR}/bookkeeper-dist/server/target/bookkeeper-server-${VERSION}-bin.tar.gz.asc ${DEST_DIR}/bookkeeper-server-${VERSION}-bin.tar.gz.asc
+cp ${SRC_DIR}/bookkeeper-dist/all/target/bookkeeper-all-${VERSION}-bin.tar.gz           ${DEST_DIR}/bookkeeper-all-${VERSION}-bin.tar.gz
+cp ${SRC_DIR}/bookkeeper-dist/all/target/bookkeeper-all-${VERSION}-bin.tar.gz.asc       ${DEST_DIR}/bookkeeper-all-${VERSION}-bin.tar.gz.asc
+echo "Copied packages."
+
+echo "Generating sha1 files ..."
+sha1sum ${DEST_DIR}/bookkeeper-${VERSION}-src.tar.gz            > ${DEST_DIR}/bookkeeper-${VERSION}-src.tar.gz.sha1
+sha1sum ${DEST_DIR}/bookkeeper-server-${VERSION}-bin.tar.gz     > ${DEST_DIR}/bookkeeper-server-${VERSION}-bin.tar.gz.sha1
+sha1sum ${DEST_DIR}/bookkeeper-all-${VERSION}-bin.tar.gz        > ${DEST_DIR}/bookkeeper-all-${VERSION}-bin.tar.gz.sha1
+echo "Generated sha1 files."
+
+cd ${DIST_DEV_DIR}/bookkeeper
+svn add ${RC_DIR}
+svn commit -m "Apache BookKeeper ${VERSION}, Release Candidate ${RC_NUM}"
diff --git a/dev/release/Dockerfile b/dev/release/Dockerfile
new file mode 100644
index 0000000..b99e262
--- /dev/null
+++ b/dev/release/Dockerfile
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+
+FROM maven:3.5.0-jdk-8
+
+RUN apt-get update
+RUN apt-get install -y g++ cmake gnupg2 vim subversion
diff --git a/site/community/release_guide.md b/site/community/release_guide.md
index 6274060..794c03f 100644
--- a/site/community/release_guide.md
+++ b/site/community/release_guide.md
@@ -51,7 +51,7 @@ In general, the community prefers to have a rotating set of 3-5 Release Managers
 
 Before your first release, you should perform one-time configuration steps. This will set up your security keys for signing the release and access to various release repositories.
 
-To prepare for each release, you should audit the project status both in the JIRA issue tracker and the Github issue tracker, and do necessary bookkeeping. Finally, you should create a release branch from which individual release candidates will be built.
+To prepare for each release, you should audit the project status in Github issue tracker, and do necessary bookkeeping. Finally, you should create a release branch from which individual release candidates will be built.
 
 ### One-time setup instructions
 
@@ -143,19 +143,7 @@ When contributors resolve an issue in GitHub, they are tagging it with a release
 
 Skip this step in case of a minor release, as milestones are only for major releases.
 
-### Triage release-blocking issues in JIRA and Github
-
-#### JIRA
-
-There could be outstanding release-blocking issues, which should be triaged before proceeding to build a release candidate. We track them by assigning a specific `Fix version` field even before the issue resolved.
-
-The list of release-blocking issues is available at the [version status page](https://issues.apache.org/jira/browse/BOOKKEEPER/?selectedTab=com.atlassian.jira.jira-projects-plugin:versions-panel). Triage each unresolved issue with one of the following resolutions:
-
-* If the issue has been resolved and JIRA was not updated, resolve it accordingly.
-* If the issue has not been resolved and it is acceptable to defer this until the next release, update the `Fix Version` field to the new version you just created. Please consider discussing this with stakeholders and the dev@ mailing list, as appropriate.
-* If the issue has not been resolved and it is not acceptable to release until it is fixed, the release cannot proceed. Instead, work with the BookKeeper community to resolve the issue.
-
-#### Github
+### Triage release-blocking issues in Github
 
 There could be outstanding release-blocking issues, which should be triaged before proceeding to build a release candidate. We track them by assigning a specific `Milestone` field even before the issue resolved.
 
@@ -165,33 +153,16 @@ The list of release-blocking issues is available at the [milestones page](https:
 * If the issue has not been resolved and it is acceptable to defer this until the next release, update the `Milestone` field to the new milestone you just created. Please consider discussing this with stakeholders and the dev@ mailing list, as appropriate.
 * If the issue has not been resolved and it is not acceptable to release until it is fixed, the release cannot proceed. Instead, work with the BookKeeper community to resolve the issue.
 
-### Review Release Notes in JIRA and Github
-
-#### JIRA
-
-JIRA automatically generates Release Notes based on the `Fix Version` field applied to issues. Release Notes are intended for BookKeeper users (not BookKeeper committers/contributors). You should ensure that Release Notes are informative and useful.
-
-Open the release notes from the [version status page](https://issues.apache.org/jira/browse/BOOKKEEPER/?selectedTab=com.atlassian.jira.jira-projects-plugin:versions-panel) by choosing the release underway and clicking Release Notes.
-
-You should verify that the issues listed automatically by JIRA are appropriate to appear in the Release Notes. Specifically, issues should:
+### Review Release Notes in Github
 
-* Be appropriately classified as `Bug`, `New Feature`, `Improvement`, etc.
-* Represent noteworthy user-facing changes, such as new functionality, backward-incompatible API changes, or performance improvements.
-* Have occurred since the previous release; an issue that was introduced and fixed between releases should not appear in the Release Notes.
-* Have an issue title that makes sense when read on its own.
-
-Adjust any of the above properties to the improve clarity and presentation of the Release Notes.
-
-#### Github
-
-> Unlike JIRA, Github does not automatically generates Release Notes based on the `Milestone` field applied to issues.
+> Github does not automatically generates Release Notes based on the `Milestone` field applied to issues.
 > We can use [github-changelog-generator](https://github.com/skywinder/github-changelog-generator) to generate a ChangeLog for a milestone in future.
 
 For Github, we can use the milestone link in the Release Notes. E.g. [Release 4.5.0 milestone](https://github.com/apache/bookkeeper/milestone/1?closed=1).
 
 #### Prepare Release Notes
 
-After review the release notes on both JIRA and Github, you should write a `releaseNotes` under `site/docs/${release_version}/overview/releaseNotes.md` and then send out a pull request for review.
+After review the release notes on both Github, you should write a `releaseNotes` under `site/docs/${release_version}/overview/releaseNotes.md` and then send out a pull request for review.
 
 [4.5.0 Release Notes](https://github.com/apache/bookkeeper/pull/402) is a good example to follow.
 
@@ -224,6 +195,10 @@ For a minor release (for instance 4.5.1):
 
 Version represents the release currently underway, while next version specifies the anticipated next version to be released from that branch. Normally, 4.5.0 is followed by 4.6.0, while 4.5.0 is followed by 4.5.1.
 
+#### Create branch for major release
+
+If you are cutting a minor release, you can skip this step and go to section [Checkout release branch](#checkout-release-branch).
+
 If you are cutting a major release use Maven release plugin to create the release branch and update the current branch to use the new development version. This command applies for the new major or minor version.
 
 > This command automatically check in and tag your code in the code repository configured in the SCM.
@@ -244,6 +219,16 @@ If you are cutting a major release use Maven release plugin to create the releas
 > $ git reset --hard apache/<master branch OR release tag>
 > $ git branch -D ${BRANCH_NAME}
 
+##### Create CI jobs for release branch
+
+Once the release branch is created, please create corresponding CI jobs for the release branch. These CI jobs includes postcommit jobs for different java versions and
+integration tests.
+
+Example PR: [release-4.7.0](https://github.com/apache/bookkeeper/pull/1328) [integration tests for release-4.7.0](https://github.com/apache/bookkeeper/pull/1353)
+
+#### Checkout release branch
+<a name="checkout-release-branch"></a>
+
 Check out the release branch.
 
     git checkout ${BRANCH_NAME}
@@ -258,14 +243,11 @@ Verify that pom.xml contains the correct VERSION, it should still end with the '
 2. Release Manager’s GPG key is configured in `git` configuration
 3. Release Manager has `org.apache.bookkeeper` listed under `Staging Profiles` in Nexus
 4. Release Manager’s Nexus User Token is configured in `settings.xml`
-5. JIRA release item for the subsequent release has been created
-6. Github milestone item for the subsequet release has been created
-7. There are no release blocking JIRA issues
-8. There are no release blocking Github issues
-9. Release Notes in JIRA have been audited and adjusted
-10. Release Notes for Github Milestone is generated, audited and adjusted
-11. Release branch has been created
-12. Originating branch has the version information updated to the new version
+5. Github milestone item for the subsequet release has been created
+6. There are no release blocking Github issues
+7. Release Notes for Github Milestone is generated, audited and adjusted
+8. Release branch has been created
+9. Originating branch has the version information updated to the new version
 
 **********
 
@@ -273,11 +255,8 @@ Verify that pom.xml contains the correct VERSION, it should still end with the '
 
 The core of the release process is the build-vote-fix cycle. Each cycle produces one release candidate. The Release Manager repeats this cycle until the community approves one release candidate, which is then finalized.
 
-### Build and stage Java artifacts with Maven
-
-
-    TODO: Currently we have to build and stage maven artifacts manually, because it requires pushing the artifacts to apache staging. We should look for a solution to automate that.
-
+> Since 4.7.0, bookkeeper is releasing a CRC32C module `circe-checksum`. so all the steps on building a release candidate should happen in linux environment.
+> It ensures the release candidate built with right jni library for `circe-checksum`.
 
 Set up a few environment variables to simplify Maven commands that follow. This identifies the release candidate being built. Start with `release candidate number` equal to `0` and increment it for each candidate.
 
@@ -287,20 +266,41 @@ Set up a few environment variables to simplify Maven commands that follow. This
 
 > Please make sure `gpg` command is in your $PATH. The maven release plugin use `gpg` to sign generated jars and packages.
 
+### Run linux docker container to build release candidate
+
+```shell
+./dev/release/000-run-docker.sh ${RC_NUM}
+```
+
+After the docker process is lauched, use `cache` credential helper to cache github credentials during releasing process.
+
+```shell
+$ git config --global credential.helper "cache --timeout=3600"
+```
+
+Then run a dry-run github push to apache github repo. You will be asked for typing your github password, so the password will be cached for the whole releasing process.
+If your account is configured with 2FA, use your personal token as the github password.
+
+The remote `apache` should point to `https://github.com/apache/bookkeeper`.
+
+```shell
+$ git push apache --dry-run
+```
+
+### Build and stage Java artifacts with Maven
+
+
 Use Maven release plugin to build the release artifacts, as follows:
 
-    mvn release:prepare \
-        -Dresume=false \
-        -DreleaseVersion=${VERSION} \
-        -Dtag=${TAG} \
-        -DupdateWorkingCopyVersions=false \
-        [-DdryRun] \
-        [-Darguments="-Dmaven.javadoc.skip=true -DskipTests=true"] \ // to skip javadoc and tests
-        [-Dresume=true] // resume prepare if it is interrupted in the middle
+```shell
+./dev/release/002-release-prepare.sh
+```
 
 Use Maven release plugin to stage these artifacts on the Apache Nexus repository, as follows:
 
-    mvn release:perform [-DdryRun] [-Darguments="-Dmaven.javadoc.skip=true -DskipTests=true"] [-Dresume=true]
+```shell
+./dev/release/003-release-perform.sh
+```
 
 > If `release:perform` failed, 
 > delete the release tag: git tag -d release-${VERSION} && git push apache :refs/tags/release-${VERSION}
@@ -308,7 +308,7 @@ Use Maven release plugin to stage these artifacts on the Apache Nexus repository
 > Also, you need to check the git commits on the github and if needed you may have to
 > force push backed out local git branch to github again.
 >
-> After reset, run `release:prepare` again.
+> After reset, run `./dev/release/002-release-prepare.sh` again.
 
 Review all staged artifacts. They should contain all relevant parts for each module, including `pom.xml`, jar, test jar, source, test source, javadoc, etc. Artifact names should follow [the existing format](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.apache.bookkeeper%22) in which artifact name mirrors directory structure, e.g., `bookkeeper-server`. Carefully review any new artifacts.
 
@@ -316,39 +316,13 @@ Close the staging repository on Apache Nexus. When prompted for a description, e
 
 ### Stage source release on dist.apache.org
 
-Copy the source release to the dev repository of `dist.apache.org`.
-
-1. If you have not already, check out the BookKeeper section of the `dev` repository on `dist.apache.org` via Subversion. In a fresh directory:
-
-        svn co https://dist.apache.org/repos/dist/dev/bookkeeper
-
-2. Make a directory for the new release:
-
-        mkdir bookkeeper/${RC_DIR}
-
-3. Copy the BookKeeper source and binary distribution, and their GPG signatures:
-
-        cp bookkeeper-dist/target/bookkeeper-${VERSION}-src.tar.gz bookkeeper/${RC_DIR}/bookkeeper-${VERSION}-src.tar.gz
-        cp bookkeeper-dist/target/bookkeeper-${VERSION}-src.tar.gz.asc bookkeeper/${RC_DIR}/bookkeeper-${VERSION}-src.tar.gz.asc
-        cp bookkeeper-dist/server/target/bookkeeper-server-${VERSION}-bin.tar.gz bookkeeper/${RC_DIR}/bookkeeper-server-${VERSION}-bin.tar.gz
-        cp bookkeeper-dist/server/target/bookkeeper-server-${VERSION}-bin.tar.gz.asc bookkeeper/${RC_DIR}/bookkeeper-server-${VERSION}-bin.tar.gz.asc
-        cp bookkeeper-dist/all/target/bookkeeper-all-${VERSION}-bin.tar.gz bookkeeper/${RC_DIR}/bookkeeper-all-${VERSION}-bin.tar.gz
-        cp bookkeeper-dist/all/target/bookkeeper-all-${VERSION}-bin.tar.gz.asc bookkeeper/${RC_DIR}/bookkeeper-all-${VERSION}-bin.tar.gz.asc
-
-4. Sign the BookKeeper source and binary distribution.
+1. Copy the source release to the dev repository of `dist.apache.org`.
 
-        cd bookkeeper/${RC_DIR}
-        sha1sum bookkeeper-${VERSION}-src.tar.gz > bookkeeper-${VERSION}-src.tar.gz.sha1
-        sha1sum bookkeeper-server-${VERSION}-bin.tar.gz > bookkeeper-server-${VERSION}-bin.tar.gz.sha1
-        sha1sum bookkeeper-all-${VERSION}-bin.tar.gz > bookkeeper-all-${VERSION}-bin.tar.gz.sha1
-
-5. Go back to BookKeeper directory, add and commit all the files.
-
-        cd ..
-        svn add ${RC_DIR}
-        svn commit
+```shell
+./dev/release/004-stage-packages.sh
+```
 
-6. Verify that files are [present](https://dist.apache.org/repos/dist/dev/bookkeeper).
+2. Verify that files are [present](https://dist.apache.org/repos/dist/dev/bookkeeper).
 
 ### Checklist to proceed to the next step
 
@@ -459,6 +433,8 @@ Use the Maven Release plugin in order to advance the version in all poms.
 For instance if you have released 4.5.1, you have to change version to 4.5.2-SNAPSHOT.
 Then you have to create a PR and submit it for review.
 
+Example PR: [release-4.7.0](https://github.com/apache/bookkeeper/pull/1350)
+
 ### Deploy artifacts to Maven Central Repository
 
 Use the Apache Nexus repository to release the staged binary artifacts to the Maven Central repository. In the `Staging Repositories` section, find the relevant release candidate `orgapachebookkeeper-XXX` entry and click `Release`. Drop all other release candidates that are not being released.
@@ -469,23 +445,6 @@ Copy the source release from the `dev` repository to the `release` repository at
 
     svn move https://dist.apache.org/repos/dist/dev/bookkeeper/bookkeeper-${VERSION}-rc${RC_NUM} https://dist.apache.org/repos/dist/release/bookkeeper/bookkeeper-${VERSION}
 
-According to [ASF policy](http://www.apache.org/legal/release-policy.html#when-to-archive), `/www.apache.org/dist` should contain the latest release in each branch that
-is currently under development. We need to remove the old releases from `release` repository.
-
-For example, if 4.6.1 is a newer release, we need to remove releases older than 4.6.1.
-
-
-    ```shell
-    // go to the directory checkout from `svn co https://dist.apache.org/repos/dist/release/bookkeeper`
-    $ cd bookkeeper
-
-    // delete old releases
-    $ svn rm <old-release>
-
-    // commit the change
-    $ svn commit -m "remove bookkeeper release <old-release>"
-    ```
-
 ### Update Website
 
 1. Create the documentation for `${VERSION}`. Run the `release.sh` to generate the branch for `${VERSION}` and bump
@@ -504,6 +463,8 @@ For example, if 4.6.1 is a newer release, we need to remove releases older than
 
 ### Update Dockerfile
 
+> NOTE: The dockerfile PR should only be merged after the release package is showed up under https://archive.apache.org/dist/bookkeeper/
+
 1. Update the `BK_VERSION` and `GPG_KEY` in `docker/Dockerfile` (e.g. [Pull Request 436](https://github.com/apache/bookkeeper/pull/436) ),
     send a pull request for review and get an approval from the community.
 
@@ -526,8 +487,12 @@ For example, if 4.6.1 is a newer release, we need to remove releases older than
 
 4. Verify the [docker hub](https://hub.docker.com/r/apache/bookkeeper/) to see if a new build for the given tag is build.
 
+5. Once the new docker image is built, update BC tests to include new docker image. Example: [release-4.7.0](https://github.com/apache/bookkeeper/pull/1352)
+
 ### Update DC/OS BookKeeper package
 
+> NOTE: Please update DC/OS bookkeeper package only after the release package is showed up under https://archive.apache.org/dist/bookkeeper/
+
 Once we have new version of BookKeeper docker image available at [docker hub](https://hub.docker.com/r/apache/bookkeeper/), We could update DC/OS BookKeeper package in [mesosphere universe](https://github.com/mesosphere/universe). A new pull request is needed in it. 
 
 It is easy if only version need be bump.
@@ -591,9 +556,7 @@ It is easy if only version need be bump.
     $ git commit -m "new bookkeeper version"
     ```
 
-### Mark the version as released in JIRA and Github
-
-In JIRA, inside [version management](https://issues.apache.org/jira/plugins/servlet/project-config/BOOKKEEPER/versions), hover over the current release and a settings menu will appear. Click `Release`, and select today’s date.
+### Mark the version as released in Github
 
 In Github, inside [milestones](https://github.com/apache/bookkeeper/milestones), hover over the current milestone and click `close` button to close a milestone and set today's date as due-date.
 
@@ -611,7 +574,7 @@ Update the [release schedule](../releases) page (only do this for feature releas
 * Website is updated with new release
 * Docker image is built with new release
 * Release tagged in the source code repository
-* Release version finalized in JIRA and Github
+* Release version finalized in Github
 * Release section with release summary is added in [releases.md](https://github.com/apache/bookkeeper/blob/master/site/releases.md)
 * Release schedule page is updated
 
@@ -674,6 +637,18 @@ Tweet, post on Facebook, LinkedIn, and other platforms. Ask other contributors t
 
 This step can be done only by PMC.
 
+### Cleanup old releases
+
+According to [ASF policy](http://www.apache.org/legal/release-policy.html#when-to-archive), `/www.apache.org/dist` should contain the latest release in each branch that
+is currently under development. We need to remove the old releases from `release` repository.
+
+For example, if 4.6.1 is a newer release, we need to remove releases older than 4.6.1.
+
+
+    ```shell
+    $ svn del https://dist.apache.org/repos/dist/release/bookkeeper/bookkeeper-${old-release} -m "remove bookkeeper release <old-release>"
+    ```
+
 ### Checklist to declare the process completed
 
 1. Release announced on the user@ mailing list.

-- 
To stop receiving notification emails like this one, please contact
sijie@apache.org.