[
https://issues.apache.org/jira/browse/STORM-243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14271114#comment-14271114
]
ASF GitHub Bot commented on STORM-243:
--------------------------------------
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/294#discussion_r22720543
--- Diff: storm-core/src/jvm/backtype/storm/utils/VersionInfo.java ---
@@ -0,0 +1,58 @@
+package backtype.storm.utils;
+
+public class VersionInfo {
+ private static Package myPackage;
+ private static VersionAnnotation version;
+
+ static {
+ myPackage = VersionAnnotation.class.getPackage();
+ version = myPackage.getAnnotation(VersionAnnotation.class);
+ }
+
+ static Package getPackage() {
+ return myPackage;
+ }
+
+ public static String getVersion() {
+ return version != null ? version.version() : "Unknown";
+ }
+
+ public static String getRevision() {
+ return version != null ? version.revision() : "Unknown";
+ }
+
+ public static String getBranch() {
+ return version != null ? version.branch() : "Unknown";
+ }
+
+ public static String getDate() {
+ return version != null ? version.date() : "Unknown";
+ }
+
+ public static String getUser() {
+ return version != null ? version.user() : "Unknown";
+ }
+
+ public static String getUrl() {
+ return version != null ? version.url() : "Unknown";
+ }
+
+ public static String getSrcChecksum() {
+ return version != null ? version.srcChecksum() : "Unknown";
+ }
+
+ public static String getBuildVersion() {
+ return VersionInfo.getVersion() + " from " + VersionInfo.getRevision()
+ + " by " + VersionInfo.getUser() + " source checksum "
+ + VersionInfo.getSrcChecksum();
+ }
+
+ public static void main(String[] args) {
+ System.out.println("Storm " + getVersion());
+ System.out.println("Subversion " + getUrl() + " -r " + getRevision());
--- End diff --
We use git by default not Subversion. I would prefer to see this changed
to not indicate the SCM used. Alternatively because we detect it in the script
we could include it as a separate parameter that is saved too.
> Record version and revision information in builds
> --------------------------------------------------
>
> Key: STORM-243
> URL: https://issues.apache.org/jira/browse/STORM-243
> Project: Apache Storm
> Issue Type: Improvement
> Reporter: caofangkun
> Assignee: caofangkun
> Priority: Minor
> Attachments: STORM-243-1.patch, ui.png
>
>
> The effect shown below,
> For Subversion project :
> $ storm version
> Storm 0.9.2-incubating-SNAPSHOT
> Subversion https://github.com/apache/incubator-storm/trunk/storm-core -r 1959
> Compiled by somebody on Wed Feb 19 11:23:38 CST 2014
> From source with checksum 9347aded8a39f3ddf8e8f2f9bf56186f
> or
> $ java -classpath storm-core-0.9.2-incubating-SNAPSHOT.jar
> backtype.storm.utils.VersionInfo
> Storm 0.9.2-incubating-SNAPSHOT
> Subversion https://github.com/apache/incubator-storm/trunk/storm-core -r 1959
> Compiled by somebody on Wed Feb 19 11:23:38 CST 2014
> From source with checksum 9347aded8a39f3ddf8e8f2f9bf56186f
> For Git Project:
> $ storm version
> ➜ storm-current storm version
> Running: ... ...
> Storm 0.10.0-SNAPSHOT
> Subversion https://github.com/caofangkun/apache-storm.git -r
> ffba148cc47a92185fa1a5db11f72982de10f106
> Branch storm-243
> Compiled by caokun on Thu Jan 8 10:47:48 CST 2015
> From source with checksum 97e7c942939e3e82dcb854b497991a51
> For UI
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)