This procedure is valid only on branch-3.5.
During 3.5 development we migrated from ANT to Maven, but we were not using the Maven Release Plugin yet.
If you are going to release 3.6 or newer please follow the current procedure.
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:
- 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.
- Now you need to register your key at http://pgp.mit.edu/ using the output of gpg --armor --export <keyid>
- Add your key to the KEYS file:
- svn co https://dist.apache.org/repos/dist/release/zookeeper/ zookeeper_dist
- cd zookeeper_dist.
- edit the KEYS file. See the top of the KEYS file for instructions on how to edit this file
- svn ci
- Upload digest to your account on id.apache.org (gpg2 --fingerprint)
...
If you have any issues (i.e. "error: gpg failed to sign the data") when trying to sign your commit (tag), refer to this gist.
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 sync: https://selfserve.apache.org/
Important Notes
- when updating JIRA be sure to use the "batch change" operator under the "tools" menu. Disable email notifications when using batch change, subsequent to large JIRA operations (moving issues btw releases, closing JIRAs after a release, etc...) send email to the dev@ list detailing the changes.
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
Code Block | ||||
---|---|---|---|---|
| ||||
Code Block | ||||
| ||||
<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> <profiles> <profile> <server> <id>apache-release<.releases.https</id> <properties> <username>YOUR_APACHE_ID</username> <!-- gpg -- <password>YOUR_APACHE_PASSWORD</password> </server> </servers> <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).
- Run unit tests on different hardwares: mac, windows, linux.
Branching and Tagging
Check out the branch you are making the release of:
Code Block git clone -b branch-X.Y https://gitbox.apache.org/repos/asf/zookeeper.git
If you are creating a point release (almost always the case) then follow this step. The exception to this is typically only when creating a new release candidate because the previous candidate failed during voting (rc0 failed and you are creating rc1+) – in which case skip this step.
Create a branch for X.Y.Z (the current release candidate)
Code Block git branch branch-VERSION=X.Y.Z NEWVERSION=X.Y.(Z+1) BRANCH_NAME=branch-$VERSION REMOTE=origin git branch $BRANCH_NAME git push <remote> branch-X.Y.Z$REMOTE $BRANCH_NAME
Update to next SNAPSHOT version
Code Block language xml mvn clean org.codehaus.mojo:versions-maven-plugin:2.7:set -DgenerateBackupPoms=false -DnewVersion=X.Y.(Z+1)-SNAPSHOT$NEWVERSION-SNAPSHOT
Also update the version number in zookeeper-client/zookeeper-client-c/configure.ac, zookeeper-client/zookeeper-client-c/CMakeLists.txt, and zookeeper-client/zookeeper-client-c/include/zookeeper_version.h to the next logical SNAPSHOT version (e.g. X.Y.Z to X.Y.(Z+1)-SNAPSHOT)Code Block cd zookeeper-client/zookeeper-client-c sed -i s/$VERSION/$NEWVERSION/g configure.ac sed -i s/$VERSION/$NEWVERSION/g CMakeLists.txt cd ../.. grep -r $NEWVERSION *
- Do a search in the project for the version with the attached -SNAPSHOT to make sure it is changed everywhere. Some files (other than pom.xml) might also contain a hard coded version.
Commit these changes.
Do a search in the project for the version with the attached -SNAPSHOT to make sure it is changed everywhere. Some files (other than pom.xml) might also contain a hard coded version.Code Block # check for modified files git status # add modified files one by one git add <modified files> # commit and push
Commit these changes.
Code Block # check for modified files git status # add modified files one by one git add <modified files> # commit and push the changes to remote repo branch-X.Y git commit -m "Prepare for the next release: update the version to X.Y.(Z+1)-SNAPSHOT" git push <remote> branch-X.Y.Z
Checkout the active point release branch - this is where you will be creating the release candidate
Code Block git checkout branch-X.Y.Z
If not already done, cherry-pick desired commits into branch-X.Y.Z. If cherry-picks are done from other than branch-X.Y ensure that those changes are also committed to branch-X.Y. If there are conflicts, then it is preferable to produce a new patch for this branch, review it separately and commit it via JIRA. Please refer HowToContribute and Committing changes page for pushing changes to the project.
Code Block # The -x option records the source commit, and reuses the original commit message git cherry-pick -x <commit-hash>
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 the https://issues.apache.org/jira/browse/ZOOKEEPER?report=com.sourcelabs.jira.plugin.portlet.releases:releases-projecttab#selectedTab=com.atlassian.jira.plugin.system.project%3Aroadmap-panel 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:Code Block language xml :%s/<\/h2>//gc :%s/<li>\[<a href='\(.*\)'>\(ZOOKEEPER-[0-9]\+\)<\/a>\] - \+/* [\2](\1) - /gc :%s/<\/li>\n//gc
Update versions in pom.xml (remove SNAPSHOT):
Code Block language xml mvn clean org.codehaus.mojo:versions-maven-plugin:2.7:set -DgenerateBackupPoms=false -DnewVersion=X.Y.Z$VERSION
Make sure the version number is correct in zookeeper-client/zookeeper-client-c/configure.ac, zookeeper-client/zookeeper-client-c/CMakeLists.txt, and zookeeper-client/zookeeper-client-c/include/zookeeper_version.h
- Update the version number in build.xml to be ''X.Y.Z'' (i.e. remove SNAPSHOT designator)
- Update the copyright years in NOTICE.txt if it's outdated.
Commit these changes.
Code Block language xml # check for modified files git status # add modified files one by one git add <modified files> # commit and push the changes to remote repo branch-X.Y-X git commit -m "Preparing for release X.Y.Z$VERSION" git push <remote> branch-X.Y.Z
Run spotBugs, checkstyle and rat checks:
Code Block git clean -xdf mvn clean apache-rat:check -DskipTests -Pfull-build mvn clean install checkstyle:check spotbugs:check -DskipTests -Pfull-build
Tag the release Tag the release candidate (R is the release candidate number, and starts from 0):
Code Block # create a signed tag git tag -s release-X.Y.Z-rcR -m "ZooKeeper X.Y.Z-rcR release." # push the newly created rc tag to the remote repo. git push <remote> release-X.Y.Z-rcR
If you have issues signing the tag, refer to this gist.
- In JiraIn Jira, move open issues to next version. Disable mail notifications for this bulk change.
Building
Build the projects with maven (we are skipping runit the unit tests here, but you should run them at least once on the release branch before continuing)
Ensure that you are using JDK8 and Maven 3.6+
There is no need to build the C client or "contrib" packages
Code Block mvn -v mvn clean install -DskipTests
- You should have the jar files and also the tarballs built. The two tarball is available at: //TODO: sign ZK jars in bin-package?
- zookeeper-assembly/target/apache-zookeeper-X.Y.Z-bin-package.tar.gz
- zookeeper-assembly/target/apache-zookeeper-X.Y.Z-source-package.tar.gz
Publishing
Once three PMC members have voted for a release, it may be published.
Sign the tarballs:
Code Block cd zookeeper-assembly/target gpg --armor --output apache-zookeeper-$VERSION-bin.tar.gz.asc --detach-sig apache-zookeeper-$VERSION-bin.tar.gz gpg --armor --output apache-zookeeper-$VERSION.tar.gz.asc --detach-sig apache-zookeeper-$VERSION.tar.gz
- Check that release file looks ok - e.g. install it and run examples from tutorial.
- untar the release artifact in a test directory
try to build the sources with
Code Block mvn clean install -DskipTests -Pfull-build
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.
Code Block sftp home.apache.org > cd public_html > mkdir zookeeper-$VERSION-candidate-0 > cd zookeeper-$VERSION-candidate-0 > put zookeeper-$VERSION.tar.gz* > bye
Deploy to the Maven Repository.
This is done using apache-release profile, coming from the apache parent pom. This will also sign your artifacts if your settings.xml is configured as mentioned above.
The following command copies all artifacts to a temporary staging Apache mvn repository in open state:Code Block mvn deploy -DskipTests -Papache-release
- Enter Apache Nexus and do the following:
Click on Log In in the upper right corner. Log in using your apache user name and password.
In the left navigation pane, select Staging Repositories.
- Identify the release candidate you just pushed, by your user name (in parentheses as part of the "Repository" name) and the "Created On" date. Click on the check box to the left of your Repository name to select it. (If you accidentally click on the Repository name itself, another tab will pop open. If so, just close it.)
Click the Close button above the Repository names. This makes your release candidate available at the Staging level.
If you have previously staged an older release candidate with the same version number, and it is still showing in the Repository list, you must select and Drop the old one now.
Confirm that your new release candidate is visible at https://repository.apache.org/content/groups/staging/org/apache/zookeeper/zookeeper/ with correct file modification dates.
Call for a release vote on dev (note dev@ and not user@, the user list is for discussion of released software only) at zookeeper.apache.org. Here is a sample email (from 3.4.6 release):
Subject: [VOTE] Apache ZooKeeper release 3.4.6 candidate 0
This is a bugfix release candidate for 3.4.6. It fixes 117 issues, including issues that
affect leader election, Zab, and SASL authentication.
The full release notes is available at:
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310801&version=12323310
*** Please download, test and vote by March 9th 2014, 23:59 UTC+0. ***
Source files:
https://people.apache.org/~fpj/zookeeper-3.4.6-candidate-0/
Maven staging repo:
https://repository.apache.org/content/groups/staging/org/apache/zookeeper/zookeeper/3.4.6/
The release candidate tag in git to be voted upon: release-X.Y.Z-rcR
ZooKeeper's KEYS file containing PGP keys we use to sign the release:
https://www.apache.org/dist/zookeeper/KEYS
Should we release this candidate?
Release Manager Signature
Publishing
Once three PMC members have voted for a release, it may be published.
Tag the release. Do it from the release branch and push the created tag to the remote repository:
Code Block # create a signed tag git tag -s release-X.Y.Z -m "ZooKeeper X.Y.Z release." # push the newly created release tag to the remote repo. git push <remote> release-X.Y.Z
- Check in release files to the distribution server
Code Block svn co https://dist.apache.org/repos/dist/release/zookeeper/ zookeeper_dist cd zookeeper_dist mkdir zookeeper-X.Y.Z # copy tgz/asc/checksum files from your public_html to zookeeper-X.Y.Z svn add zookeeper-X.Y.Z svn ci -m "Add ZooKeeper X.Y.Z release" --username <your apache user ID>
- After checking in the release, you'll receive an automated email from reporter.apache.org with a link requesting additional details about the release. This form must be completed by a PMC member. If you are a PMC members, follow the link and complete the form. If you are not a PMC member, forward the email to dev@zookeeper.apache.org and ask for assistance from a PMC member.
The release directory usually contains just two releases, the most recent from two branches, with a link named 'stable' to the most recent recommended version.
Code Block cd zookeeper_dist svn rm zookeeper-A.B.C # apache folks don't like old releases hanging around - they are available in the archive if people need access rm stable; rm current ln -s zookeeper-A.B.D stable ln -s zookeeper-A.B.D current svn ci -m 'Updating links'
- Release the Maven artifacts on Apache Nexus:
- Click on 'Staging repositories'.
- Select the repository corresponding to the release candidate.
- Click on the 'Release' button and follow instructions.
- Wait 24 hours for release to propagate to mirrors.
Prepare to edit the website. ZooKeeper uses Jekyll/Markdown with gitpubsub. See WebSiteSetup for general instructions and tool setup/prerequisites.
Code Block git clone -b website https://gitbox.apache.org/repos/asf/zookeeper.git
Copy the new release documentation into the _released_docs directory
Code Block cd _released_docs mkdir rX.Y.Z cd rX.Y.Z tar xvf apache-zookeeper-X.Y.Z-bin.tar.gz --strip-components 2 'apache-zookeeper-X.Y.Z-bin/docs' rm apache-zookeeper-X.Y.Z-bin.tar.gz # Update the "current" doc pointer if necessary (next 2 lines) cd .. rm current ln -s rX.Y.Z current git add rX.Y.Z current cd ..
- Change directory to src/main/resources/markdown
- Update the release news in releases.md
- Update the nav panel in html/header.html and documentation.md to include X.Y.Z
Stage changes to git
Code Block git add releases.md documentation.md html/header.html
Regenerate the site, review it, then commit it. (for possible prerequisites, see the README.md in website branch)
Code Block mvn clean install cp -RP _released_docs target/html/doc # at this point verify that the site is working properly - open target/html/index.html # once you are happy move on to the next step... git commit -m "Updated website content for release X.Y.Z." git push origin website
Deploy: you are now ready to deploy the changes to the public website using gitpubsub. Using the same repo as the previous step:
Code Block git checkout asf-site rm -fr content mv target/html content git add content # verify that the content of "content" looks proper. open content/index.html in a browser and verify, etc... # verify git staging looks proper - remember, we added the release docs to content/doc/rX.Y.Z and that will also be added here git commit -m "Website update for release X.Y.Z" git push origin asf-site
If the apache zookeeper website does not update, check if the commit is mirrored into github.com/apache/zookeeper asf-site branch
Send announcements to the user and developer lists once the site changes are visible. Here is a sample email:
No Format Subject: [ANNOUNCE] Apache ZooKeeper X.Y.Z The Apache ZooKeeper team is proud to announce Apache ZooKeeper version X.Y.Z ZooKeeper is a high-performance coordination service for distributed applications. It exposes common services - such as naming, configuration management, synchronization, and group services - in a simple interface so you don't have to write them from scratch. You can use it off-the-shelf to implement consensus, group management, leader election, and presence protocols. And you can build on it for your own, specific needs. For ZooKeeper release details and downloads, visit: https://zookeeper.apache.org/releases.html ZooKeeper X.Y.Z Release Notes are at: https://zookeeper.apache.org/doc/rX.Y.Z/releasenotes.html We would like to thank the contributors that made the release possible. Regards, The ZooKeeper Team
- In Jira, ensure that only issues in the "Fixed" state have a "Fix Version" set to release X.Y.Z.
- In Jira, "release" the version. Visit the "Administer Project" page, then the "Manage versions" page. You need to have the "Admin" role in ZooKeeper's Jira for this step and the next
Deploy to the Maven Repository.
This is done using apache-release profile, coming from the apache parent pom. This will also sign your artifacts if your settings.xml is configured as mentioned above.
The following command copies all artifacts to a temporary staging Apache mvn repository in open state:
Make the release candidate availableCode Block mvn deploy -DskipTests -Papache-release
You can check the artifacts you just uploaded in the Apache’s Nexus at repository.apache.org using your Apache ID. Click 'Staging Repositories' and look for a new ZooKeeper repository with a status of 'Open'. Check that all the artifacts and pom files are available. As long as this is in open state, you can re-upload your files. Or just use 'Drop' on the staging repo.
If it checks out, close the repo using the 'Close' button. The repository must be closed before a public URL to it becomes available. It may take a few minutes for the repository to close. Once complete you’ll see a public URL to the repository in the Nexus UI. You may also receive an email with the URL. Provide the URL to the temporary staging repository in the email that announces the release candidate.
When the release vote concludes successfully, return here and click the 'Release' button to release the artifacts to central. The release process will automatically drop and delete the staging repository- .
- In Jira, close issues resolved in the release. Disable mail notifications for this bulk change.
Smoke Tests
Before the release, run the following smoke tests (at least).
- Run unit tests on different hardwares: mac, windows, linux.