From b2f0eaaf9d2a2173ea98d3be49e129af2f89e11d Mon Sep 17 00:00:00 2001 From: Mars Lan Date: Tue, 18 Apr 2017 18:06:26 -0700 Subject: [PATCH] Add app.version play config and have the value exposed via the config API. (#447) --- web/app/controllers/Application.java | 2 ++ web/conf/application.conf | 2 ++ 2 files changed, 4 insertions(+) diff --git a/web/app/controllers/Application.java b/web/app/controllers/Application.java index a07ab8598f..8e7d2db76d 100644 --- a/web/app/controllers/Application.java +++ b/web/app/controllers/Application.java @@ -38,6 +38,7 @@ import security.AuthenticationManager; public class Application extends Controller { private static String TREE_NAME_SUBFIX = ".tree.name"; + private static final String APP_VERSION = Play.application().configuration().getString("app.version"); private static final String PIWIK_SITE_ID = Play.application().configuration().getString("tracking.piwik.siteid"); private static final String PIWIK_URL = Play.application().configuration().getString("tracking.piwik.url"); private static final Boolean IS_INTERNAL = Play.application().configuration().getBoolean("linkedin.internal", false); @@ -78,6 +79,7 @@ public class Application extends Controller ObjectNode response = Json.newObject(); ObjectNode config = Json.newObject(); + config.put("appVersion", APP_VERSION); config.put("isInternal", IS_INTERNAL); config.put("tracking", trackingInfo()); response.put("status", "ok"); diff --git a/web/conf/application.conf b/web/conf/application.conf index 821f145cc8..399099d3c4 100644 --- a/web/conf/application.conf +++ b/web/conf/application.conf @@ -44,6 +44,8 @@ play.i18n.langs = [ "en" ] # You can disable evolutions for a specific datasource if necessary # play.evolutions.db.default.enabled=false +app.version = "$YOUR_APP_VERSION" + datasets.tree.name = "/var/tmp/wherehows/resource/dataset.json" datasets.tree.name = ${?DATASETS_TREE_NAME} flows.tree.name = "/var/tmp/wherehows/resource/flow.json"