Setting up the signing keys

Before you do a release you'll need a signing key that is registered with apache. If you already have one, you can skip this section. Otherwise, here are the steps to do:

  1. use gpg2 --gen-key to generate a new key. Make sure that the key size is 4096 bits, the key doesn't expire, and use CODE SIGNING KEY for the comment.
  2. Now you need to register your key at http://pgp.mit.edu/ using the output of gpg --armor --export <keyid>
  3. Add your key to the KEYS file:
    1. svn co https://dist.apache.org/repos/dist/release/zookeeper/ zookeeper_dist
    2. cd zookeeper_dist.
    3. edit the KEYS file. See the top of the KEYS file for instructions on how to edit this file
    4. svn ci
  4. Upload digest to your account on id.apache.org (gpg2 --fingerprint)

Useful Links and Background:

Apache infra page: https://cwiki.apache.org//confluence/display/INFRA/Index

Apache self-service page - now allows for forcing git repo synchttps://selfserve.apache.org/

Important Notes

Configuring maven

Make sure your settings.xml in ~/.m2 contain logins for apache repos, and your signing key is published and configured here.

Please follow the instructions here to encrypt your Apache credentials: https://maven.apache.org/guides/mini/guide-encryption.html

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
    <!-- To publish a snapshot -->
    <server>
      <id>apache.snapshots.https</id>
      <username>YOUR_APACHE_ID</username>
      <password>YOUR_APACHE_PASSWORD</password>
    </server>

    <!-- To stage a release -->
    <server>
      <id>apache.staging.https</id>
      <username>YOUR_APACHE_ID</username>
      <password>YOUR_APACHE_PASSWORD</password>
    </server>
  </servers>

  <server>
   	<id>apache.releases.https</id>
    <username>YOUR_APACHE_ID</username>
    <password>YOUR_APACHE_PASSWORD</password>
  </server>

  <profiles>
    <profile>
      <id>apache-release</id>
      <properties>
	    <!-- gpg --list-keys will show you your keyname ( something like 00A5F21E) -->
    	<gpg.keyname>YOUR_KEYNAME</gpg.keyname>
  		<gpg.passphrase>YOUR_KEY_PASSWORD</gpg.passphrase>
      </properties>
    </profile>
  </profiles>
</settings>

For a more detailed steps, check out How To Release page for Hadoop. It is used as a base.

Smoke Tests

Before the release, run the following smoke tests (at least).

Checkout a fresh new clone

Check out a fresh new copy of the repository:

git clone https://gitbox.apache.org/repos/asf/zookeeper.git
cd zookeeper

Test your docker environment

We are going to perform the full procedure using docker, this way we are sure that the binary artifacts are built using a know environment:

Enter the docker environment (this should work on Mac and on Linux).

In some environment  with SELinux you have to enable "permissive mode" ("sudo setenforce Permissive")

dev/docker/run.sh

Build Java anc C sources, run tests and test GPG signature

export GPG_TTY=$(tty)

mvn clean install -Pfull-build -Papache-release -DskipTests 
mvn dependency-check:check  


Manage JiRA issues


Create a branch (when you create X.Y.0 and move master to X.Y+1.0)

Create a branch for X.Y.Z (the current release candidate)

RC_NUM=0
BRANCH_NAME=branch-3.6
WORK_BRANCH=branch-3.6.0
RELEASE_DEVELOPMENT_VERSION=3.6.1-SNAPSHOT
RELEASE_VERSION=3.6.0
MASTER_DEVELOPMENT_VERSION=3.7.0-SNAPSHOT
TAG=release-$RELEASE_VERSION-$RC_NUM


git checkout master
git pull --rebase
git clean -xdf
mvn release:clean
mvn release:branch \
    -DbranchName=$BRANCH_NAME \
    -DdevelopmentVersion=$MASTER_DEVELOPMENT_VERSION \
    -Pfull-build

That command will:

The goal "branch" in Maven Release plugin does not support "preparationGoals" and "completionGoals" so we have to to manually change the version inside the C-client

So now you have to set the version in zookeeper-client/zookeeper-client-c

In 3.7.0 we have:

Then push a commit with the fix.

It is now time to create CI jobs for the new branch, if you do not have permissions to edit CI configuration just send an email to dev@zookeeper.apache.org


Preparation for minor release, say 3.6.1

If you are releasing a version that is not the first one of a main branch just checkout the release branch

RC_NUM=0
BRANCH_NAME=branch-3.6
WORK_BRANCH=branch-3.6.1
RELEASE_DEVELOPMENT_VERSION=3.6.2-SNAPSHOT
RELEASE_VERSION=3.6.1
TAG=release-$RELEASE_VERSION-$RC_NUM

git checkout $BRANCH_NAME
git pull
git push --dry-run

Create a work branch for the release

If you are releasing a version that is not the first one of a main branch just checkout the release branch

RC_NUM=0
BRANCH_NAME=branch-3.6
WORK_BRANCH=branch-3.6.0
RELEASE_DEVELOPMENT_VERSION=3.6.1-SNAPSHOT
RELEASE_VERSION=3.6.0
TAG=release-$RELEASE_VERSION-$RC_NUM

git checkout $BRANCH_NAME
git checkout -b $WORK_BRANCH
git pull
git push --set-upstream origin $WORK_BRANCH
git status
# you are now in release-x.y.z branch

Create release notes on release branch

Update the copyright years in NOTICE.txt if it's outdated.

Update zookeeper-docs/src/main/resources/markdown/releasenotes.md with release notes for this release. You can get the HTML by following the "Release Notes" link for the relevant release on thehttps://issues.apache.org/jira/projects/ZOOKEEPER?selectedItem=com.atlassian.jira.jira-projects-plugin%3Arelease-page&status=unreleased  tab in Jira. Note that you need to exclude the won't fix or invalid tickets.
Hints for editing releasenotes.md (using vim) - you can skip 'c' parameter, it tells vim to ask for all replacement:

:%s/<\/h2>//gc
:%s/<li>\[<a href='\(.*\)'>\(ZOOKEEPER-[0-9]\+\)<\/a>\] - \+/* [\2](\1) - /gc
:%s/<\/li>\n//gc

Push these changes to the $WORK_BRANCH (release-3.6.0) and to the $RELEASE_BRANCH (branch-3.6)  (no review is needed at this point)

In case you have to run more than one RC you have to update the release notes every time and push them to those two branches.

Build and check that the release branch is in good shape

Run spotBugs, checkstyle, rat and OWASP checks:

git checkout $WORK_BRANCH
git clean -xdf
# perform quality checks
mvn clean apache-rat:check -DskipTests -Pfull-build -Papache-release
mvn clean install checkstyle:check spotbugs:check -DskipTests -Pfull-build -Papache-release 
mvn dependency-check:check 

Perform a release on branch (for major and minor release)  (remove SNAPSHOT and create tag)

git checkout $WORK_BRANCH
git clean -xdf

mvn release:prepare \
   -DautoVersionSubmodules=true  \
   -DreleaseVersion=$RELEASE_VERSION \
   -Dtag=$TAG  \
   -DdevelopmentVersion=$RELEASE_DEVELOPMENT_VERSION \
   -Darguments='-DskipTests=true -Pfull-build,apache-release' \
   -Pfull-build,apache-release

see details in 

The command above perform the following activities:

Preparing the release candidate (prepare stage artifacts for VOTE)

Self validate the Release candidate

Check that release file looks ok - e.g. install it and run examples from tutorial.

mvn clean install -DskipTests -Pfull-build

Close the Maven Repository

Stage source and binaries to your own Apache home (old procedure)

Copy release files to a public place and ensure they are readable. Note that home.apache.org only supports SFTP, so this may be easier with a graphical SFTP client like Nautilus, Konqueror, etc.


Stage source and binaries to Apache dev repo

Copy release files to a public place and ensure they are readable. 

# Staged artifacts built by "release:perform" are in target/checkout

ZKHOME=where you have your work directory "zookeeper"
svn co https://dist.apache.org/repos/dist/dev/zookeeper/ zookeeper_dev
cd zookeeper_dev
mkdir zookeeper-$VERSION-candidate-0
cd zookeeper-$VERSION-candidate-0
cp $ZKHOME/target/checkout/target/*.tar.gz* .
cp $ZKHOME/target/checkout/zookeeper-assembly/target/*-bin.tar.gz* .
rm *.asc.sha512

mkdir website
cp -r $ZKHOME/target/checkout/zookeeper-docs/target/html/* website/
cd ..
svn add zookeeper-$VERSION-candidate-0
svn ci -m "Add ZooKeeper X.Y.Z release candidate 0" 

Call for VOTE

Cancelling a Release Candidate

In case you get a -1 you have to work together with the community in order to see if that vote is a real blocker for the release or not.

In case it is a real blocker we have to fix the problem and cherry-pick the fix to $BRANCH_NAME and to $WORK_BRANCH

Send an explicit email in answer to the VOTE thread and state that current RC VOTE is cancelled.

"Drop" the Maven Staging Repository at repository.apache.org

Then when you are okay restart from "Perform a release on branch" step

Publishing