本教程只适用于 Apache Kylin Committers。
以在 Mac OS X 上的 Shell 命令作为样例。
对于中国用户,请谨慎使用代理以避免潜在的防火墙问题。
确保您有可使用的账号且对以下应用有权限:
按照 http://www.apache.org/dev/release-signing 上的说明创建密钥对
安装 gpg(以 Mac OS X 为例): brew install gpg
生成 gpg 密钥: 参考: https://www.gnupg.org/gph/en/manual/c14.html
生成的所有新 RSA 密钥应至少为 4096 位。不要生成新的 DSA 密钥gpg --full-generate-key
验证您的密钥:gpg --list-sigs YOUR_NAME
获取密钥的指纹: gpg --fingerprint YOUR_NAME
它将显示指纹,如 “Key fingerprint = XXXX XXXX ...”,然后在 https://id.apache.org/ 上的 “OpenPGP Public Key Primary Fingerprint” 字段处将指纹添加到您的 apache 帐户;等待几个小时,密钥将添加到 https://people.apache.org/keys/,例如: https://people.apache.org/keys/committer/lukehan.asc
生成 ASCII Amromed 键:gpg -a --export YOUR_MAIL_ADDRESS > YOUR_NAME.asc &
上传密钥到公共服务器:gpg --send-keys YOUR_KEY_HASH
或通过 web 提交密钥:
打开并提交到 http://pool.sks-keyservers.net:11371(您可以选择任意一个有效的公钥服务器)
一旦您的密钥提交到服务器,您可以通过使用以下命令验证:gpg --recv-keys YOUR_KEY_HASH 举例:gpg --recv-keys 027DC364
按照 KEYS 文件中的说明将公钥添加到 KEYS 文件:
KEYS 文件位于: ${kylin}/KEYS
例如:(gpg --list-sigs YOURNAME && gpg --armor --export YOURNAME) >> KEYS
提交您的改动。
开始前:
在 Maven 中配置 Apache 存储库服务器 如果您是第一次发布,您需要在 ~/.m2/settings.xml 中服务器授权信息;如果该文件不存在,从 $M2_HOME/conf/settings.xml 拷贝一个模板;
在 “服务器” 部分中,确保添加以下服务器,并将 #YOUR_APACHE_ID#, #YOUR_APACHE_PWD#, #YOUR_GPG_PASSPHRASE# 替换为您的 ID,密码和口令: {% highlight bash %} apache.snapshots.https #YOUR_APACHE_ID# #YOUR_APACHE_PWD# apache.releases.https #YOUR_APACHE_ID# #YOUR_APACHE_PWD#
<!-- To publish a website of some part of Maven --> <server> <id>apache.website</id> <username>#YOUR_APACHE_ID#</username> <password>#YOUR_APACHE_PWD#</password> <!-- Either <privateKey>...</privateKey> --> <filePermissions>664</filePermissions> <directoryPermissions>775</directoryPermissions> </server> <!-- To stage a website of some part of Maven --> <server> <id>stagingSite</id> <!-- must match hard-coded repository identifier in site:stage-deploy --> <username>#YOUR_APACHE_ID#</username> <filePermissions>664</filePermissions> <directoryPermissions>775</directoryPermissions> </server> <server> <id>gpg.passphrase</id> <passphrase>#YOUR_GPG_PASSPHRASE#</passphrase> </server>
修复许可证问题 {% highlight bash %}
$ read -s GPG_PASSPHRASE
$ git clean -xf $ mvn clean
$ mvn test
org.apache.kylin.common.KylinVersion 类,确保 CURRENT_KYLIN_VERSION的值是发行版本$ mvn -Papache-release -DskipTests -Dgpg.passphrase=${GPG_PASSPHRASE} install {% endhighlight %}
可选的,当 dry-run 成功了,将安装变为部署: {% highlight bash %} $ mvn -Papache-release -DskipTests -Dgpg.passphrase=${GPG_PASSPHRASE} deploy {% endhighlight %}
准备 检查并确保你可以 ssh 连接到 github: {% highlight bash %} ssh -T git@github.com {% endhighlight %}
基于要当前的开发分支,创建一个以 release 版本号命名的发布分支,例如,v2.5.0-release(注意分支名字不能与 tag 名字相同),并将其推到服务器端。
{% highlight bash %} $ git checkout -b vX.Y.Z-release $ git push -u origin vX.Y.Z-release {% endhighlight %}
如果任何步骤失败,请清理(见下文),解决问题,然后从头重新开始。
{% highlight bash %}
$ read -s GPG_PASSPHRASE
$ git clean -xf $ mvn clean
$ mvn -DdryRun=true -DskipTests -DreleaseVersion=X.Y.Z -DdevelopmentVersion=(X.Y.Z+1)-SNAPSHOT -Papache-release -Darguments=“-Dgpg.passphrase=${GPG_PASSPHRASE} -DskipTests” release:prepare 2>&1 | tee /tmp/prepare-dry.log {% endhighlight %}
查看 dry run 输出:
target 目录中应该是这 8 个文件,其中包括:apache-kylin- 开始.zip 文件中,检查所有文件是否属于名为 apache-kylin-X.Y.Z-SNAPSHOT 的目录NOTICE,LICENSE,README.md 文件运行真实的 release: 现在真正开始 release
{% highlight bash %}
$ mvn -DskipTests -DreleaseVersion=X.Y.Z -DdevelopmentVersion=(X.Y.Z+1)-SNAPSHOT -Papache-release -Darguments=“-Dgpg.passphrase=${GPG_PASSPHRASE} -DskipTests” release:prepare
$ mvn -DskipTests -Papache-release -Darguments=“-Dgpg.passphrase=${GPG_PASSPHRASE} -DskipTests” release:perform {% endhighlight %}
一个失败的 release 后进行清理: {% highlight bash %}
$ git tag
$ git tag -d kylin-X.Y.Z $ git push origin :refs/tags/kylin-X.Y.Z
$ mvn release:clean
$ git status $ git reset --hard HEAD {% endhighlight %}
关闭 Nexus 仓库中的阶段性工件:
Build Promotion 下,点击 Staging RepositoriesStaging Repositories 选项卡中,应该有一个包含配置文件 org.apache.kylin 的行上传到临时区域:
通过 subversion 将工件上传到临时区域,https://dist.apache.org/repos/dist/dev/kylin/apache-kylin-X.Y.Z-rcN: {% highlight bash %}
$ mkdir -p ~/dist/dev $ pushd ~/dist/dev $ svn co https://dist.apache.org/repos/dist/dev/kylin $ popd
$ cd target $ mkdir ~/dist/dev/kylin/apache-kylin-X.Y.Z-rcN $ mv apache-kylin-* ~/dist/dev/kylin/apache-kylin-X.Y.Z-rcN
$ rm ~/dist/dev/kylin/apache-kylin-X.Y.Z-rcN/apache-kylin-X.Y.Z-SNAPSHOT-source-release.zip.asc.sha256
$ cd ~/dist/dev/kylin $ svn add apache-kylin-X.Y.Z-rcN $ svn commit -m ‘Upload release artifacts to staging’ --username <YOUR_APACHE_ID> {% endhighlight %}
{% highlight bash %}
$ mvn test
$ gpg --recv-keys key
$ curl -O https://dist.apache.org/repos/dist/release/kylin/KEYS
function checkHash() { cd “$1” for i in *.{pom,gz}; do if [ ! -f $i ]; then continue fi if [ -f $i.sha256 ]; then if [ “$(cat $i.sha256)” = “$(shasum -a 256 $i)” ]; then echo $i.sha256 present and correct else echo $i.sha256 does not match fi else shasum -a 256 $i > $i.sha256 echo $i.sha256 created fi done }; $ checkHash apache-kylin-X.Y.Z-rcN {% endhighlight %}
在 Apache Kylin dev 邮件列表上投票
在 dev 邮件列表上进行 release 投票,使用由 Maven release plugin 生成的 commit id,其消息看起来像 “[maven-release-plugin] prepare release kylin-x.x.x”:
{% highlight text %} To: dev@kylin.apache.org Subject: [VOTE] Release apache-kylin-X.Y.Z (RC[N])
Hi all,
I have created a build for Apache Kylin X.Y.Z, release candidate N.
Changes highlights: ...
Thanks to everyone who has contributed to this release. Here’s release notes: https://github.com/apache/kylin/blob/XXX/docs/release_notes.md
The commit to be voted upon:
https://github.com/apache/kylin/commit/xxx
Its hash is xxx.
The artifacts to be voted on are located here: https://dist.apache.org/repos/dist/dev/kylin/apache-kylin-X.Y.Z-rcN/
The hash of the artifact is as follows: apache-kylin-X.Y.Z-source-release.zip.sha256 xxx
A staged Maven repository is available for review at: https://repository.apache.org/content/repositories/orgapachekylin-XXXX/
Release artifacts are signed with the following key: https://people.apache.org/keys/committer/lukehan.asc
Please vote on releasing this package as Apache Kylin X.Y.Z.
The vote is open for the next 72 hours and passes if a majority of at least three +1 PMC votes are cast.
[ ] +1 Release this package as Apache Kylin X.Y.Z [ ] 0 I don‘t feel strongly about it, but I’m okay with the release [ ] -1 Do not release this package because...
Here is my vote:
+1 (binding)
{% endhighlight %}
投票完成后,发出结果:
{% highlight text %} Subject: [RESULT][VOTE] Release apache-kylin-X.Y.Z (RC[N]) To: dev@kylin.apache.org
Thanks to everyone who has tested the release candidate and given their comments and votes.
The tally is as follows.
N binding +1s:
N non-binding +1s:
No 0s or -1s.
Therefore I am delighted to announce that the proposal to release Apache-Kylin-X.Y.Z has passed.
{% endhighlight %}
成功发布投票后,我们需要推动发行到镜像,以及其它任务。
在 JIRA 中,搜索 all issues resolved in this release,并进行批量更新,将它们的状态更改为 “关闭”,并加上更改的评论 “Resolved in release X.Y.Z (YYYY-MM-DD)” (填写适当的发布号和日期)。
取消 “Send mail for this update”。
标记 JIRA 系统中发布的版本,管理版本。
推广分阶段的 nexus 工件。
将工件检入 svn。 {% highlight bash %}
$ mkdir -p ~/dist/dev $ cd ~/dist/dev $ svn co https://dist.apache.org/repos/dist/dev/kylin
$ mkdir -p ~/dist/release $ cd ~/dist/release $ svn co https://dist.apache.org/repos/dist/release/kylin $ cd kylin $ mkdir apache-kylin-X.Y.Z $ cp -rp ../../dev/kylin/apache-kylin-X.Y.Z-rcN/apache-kylin* apache-kylin-X.Y.Z/ $ svn add apache-kylin-X.Y.Z
svn commit -m ‘checkin release artifacts’ {% endhighlight %}
Svnpubsub 将会发布到 https://dist.apache.org/repos/dist/release/kylin 并会在 24 小时内传播到 http://www.apache.org/dyn/closer.cgi/kylin。
如果现在有超过 2 个版本,请清除最旧的版本:
{% highlight bash %} cd ~/dist/release/kylin svn rm apache-kylin-X.Y.Z svn commit -m ‘Remove old release’ {% endhighlight %}
旧版本将保留在 release archive。
在 JIRA 中发布相同版本,检查最新发布版本的更改日志。
发布后,您需要生成二进制包并将它们放入到 VPN 发布库中:
使用 git fetch --all --prune --tags 来同步您本地和远程的仓库;
Git 检出当前发布的标签;
通过参考此文档制作二进制包;
使用 gpg 对生成的二进制包进行签名,例如: {% highlight bash %} gpg --armor --output apache-kylin-2.5.0-bin.tar.gz.asc --detach-sig apache-kylin-2.5.0-bin.tar.gz {% endhighlight %}
生成二进制包的 sha256 文件,例如: {% highlight bash %} shasum -a 256 apache-kylin-2.5.0-bin.tar.gz > apache-kylin-2.5.0-bin.tar.gz.sha256
on Linux: openssl sha256 apache-kylin-2.5.0-bin.tar.gz > apache-kylin-2.5.0-bin.tar.gz.sha256 {% endhighlight %}
将二进制包,签名文件和 sha256 文件推送到 svn dev 仓库,然后运行 svn mv <files-in-dev> <files-in-release> 命令将他们移动到 svn release 仓库;
对于不同的 Hadoop/HBase 版本,您可能需要上述步骤;
添加文件,然后将更改提交 svn。
发布后,您需要更新一些源代码:
把分布分支,如 v2.5.0-release,合并到开发分支中,如 2.5.x,以便开始下个版本的开发。
手动更新 KylinVersion 类,将 CURRENT_KYLIN_VERSION 的值更改为当前开发版本。
更多细节参考如何写文档。
发送一个邮件主题如 “[Announce] Apache Kylin x.y.z released” 到以下列表:
这是一个公告电子邮件的样本(通过研究 Kafka):
{% highlight text %} The Apache Kylin team is pleased to announce the immediate availability of the 2.5.0 release.
This is a major release after 2.4, with more than 100 bug fixes and enhancements; All of the changes in this release can be found in: https://kylin.apache.org/docs/release_notes.html
You can download the source release and binary packages from Apache Kylin's download page: https://kylin.apache.org/download/
Apache Kylin is an open source Distributed Analytics Engine designed to provide SQL interface and multi-dimensional analysis (OLAP) on Apache Hadoop, supporting extremely large datasets.
Apache Kylin lets you query massive data set at sub-second latency in 3 steps:
Thanks everyone who have contributed to the 2.1.0 release.
We welcome your help and feedback. For more information on how to report problems, and to get involved, visit the project website at https://kylin.apache.org/
{% endhighlight %}
本指南起草于 Apache Calcite Howto doc 的参考资料,非常感谢。