From a11cf9c642ae4e645e683375e6a1bd6413e9327c Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 17 Nov 2021 23:00:52 +0000 Subject: [PATCH] [Trunk | Monitor Service]: 1. pom.xml: Updated version of "uoa-admin-tools-library" from 1.0.1 to 1.0.2, "uoa-authorization-library" from 1.0.0 to 2.0.1, "uoa-notification-service" from 1.0.0 to 1.0.2. 2. GlobalVars.java: Added field "version" (version of project in pom). 3. MonitorServiceCheckDeployController.java: Expose globalBars.version in /health_check/advanced. 4. monitorservice.properties: Added monitorservice.globalVars.version=@version@ (initialized by pom version). --- pom.xml | 7 ++++--- .../uoamonitorservice/configuration/GlobalVars.java | 9 +++++++++ .../controllers/MonitorServiceCheckDeployController.java | 3 +++ src/main/resources/monitorservice.properties | 1 + 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 9dd1764..b8de3fb 100644 --- a/pom.xml +++ b/pom.xml @@ -89,17 +89,18 @@ eu.dnetlib uoa-admin-tools-library - 1.0.1 + + 1.0.2 eu.dnetlib uoa-authorization-library - 1.0.0 + 2.0.1 eu.dnetlib uoa-notification-service - 1.0.0 + 1.0.2 org.springframework.boot diff --git a/src/main/java/eu/dnetlib/uoamonitorservice/configuration/GlobalVars.java b/src/main/java/eu/dnetlib/uoamonitorservice/configuration/GlobalVars.java index 8527e47..1631c86 100644 --- a/src/main/java/eu/dnetlib/uoamonitorservice/configuration/GlobalVars.java +++ b/src/main/java/eu/dnetlib/uoamonitorservice/configuration/GlobalVars.java @@ -8,6 +8,7 @@ import java.util.Date; public class GlobalVars { public static Date date = new Date(); private Date buildDate; + private String version; public String getBuildDate() { if(buildDate == null) { @@ -19,4 +20,12 @@ public class GlobalVars { public void setBuildDate(Date buildDate) { this.buildDate = buildDate; } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } } diff --git a/src/main/java/eu/dnetlib/uoamonitorservice/controllers/MonitorServiceCheckDeployController.java b/src/main/java/eu/dnetlib/uoamonitorservice/controllers/MonitorServiceCheckDeployController.java index 87434a4..013c150 100644 --- a/src/main/java/eu/dnetlib/uoamonitorservice/controllers/MonitorServiceCheckDeployController.java +++ b/src/main/java/eu/dnetlib/uoamonitorservice/controllers/MonitorServiceCheckDeployController.java @@ -66,6 +66,9 @@ public class MonitorServiceCheckDeployController { if(globalVars.getBuildDate() != null) { response.put("Date of build", globalVars.getBuildDate()); } + if(globalVars.getVersion() != null) { + response.put("Version", globalVars.getVersion()); + } return response; } diff --git a/src/main/resources/monitorservice.properties b/src/main/resources/monitorservice.properties index 9559fdd..8ccd226 100644 --- a/src/main/resources/monitorservice.properties +++ b/src/main/resources/monitorservice.properties @@ -9,6 +9,7 @@ monitorservice.mongodb.host=localhost monitorservice.mongodb.port=27017 monitorservice.mongodb.database=openaire_monitor3 monitorservice.globalVars.buildDate=@timestamp@ +monitorservice.globalVars.version=@version@ #beta #monitorservice.userInfoUrl = https://beta.services.openaire.eu/uoa-user-management/api/users/getUserInfo?accessToken=