From ebf9b4210188d8439a5adf26c4d14fca34e1ae65 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Mon, 14 Sep 2020 10:41:31 -0400 Subject: [PATCH] print version on startup --- .../src/main/java/bubble/server/BubbleConfiguration.java | 2 +- bubble-server/src/main/java/bubble/server/BubbleServer.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java b/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java index 78dfc441..1352ac3b 100644 --- a/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java +++ b/bubble-server/src/main/java/bubble/server/BubbleConfiguration.java @@ -246,7 +246,7 @@ public class BubbleConfiguration extends PgRestServerConfiguration return SCHEME_HTTPS + node.getFqdn() + ":" + node.getSslPort() + getHttp().getBaseUri(); } - private String getVersion () { + public static String getVersion () { final Properties properties = new Properties(); try { properties.load(loadResourceAsStream("META-INF/bubble/bubble.properties")); diff --git a/bubble-server/src/main/java/bubble/server/BubbleServer.java b/bubble-server/src/main/java/bubble/server/BubbleServer.java index a59a70ae..47d8f311 100644 --- a/bubble-server/src/main/java/bubble/server/BubbleServer.java +++ b/bubble-server/src/main/java/bubble/server/BubbleServer.java @@ -31,6 +31,7 @@ import java.util.concurrent.atomic.AtomicReference; import static bubble.ApiConstants.HOME_DIR; import static bubble.model.cloud.BubbleNode.nodeFromFile; +import static bubble.server.BubbleConfiguration.getVersion; import static bubble.service.boot.StandardSelfNodeService.THIS_NODE_FILE; import static org.cobbzilla.util.daemon.ZillaRuntime.die; import static org.cobbzilla.util.daemon.ZillaRuntime.empty; @@ -86,14 +87,14 @@ public class BubbleServer extends RestServerBase { restoreKey.set(getRestoreKey()); if (restoreKey.get() != null) { - log.info("Starting BubbleServer in restore mode..."); + log.info("Starting BubbleServer ("+getVersion()+") in restore mode..."); main(BubbleServer.class, RESTORE_LIFECYCLE_LISTENERS, configSource, env); } else { if (Boolean.parseBoolean(env.get(BUBBLE_DUMP_CONFIG))) { log.info("Dumping BubbleConfiguration..."); dumpConfig(configSource); } else { - log.info("Starting BubbleServer..."); + log.info("Starting BubbleServer ("+getVersion()+")..."); main(BubbleServer.class, LIFECYCLE_LISTENERS, configSource, env); } }