Skip to content
Snippets Groups Projects
Commit 8dfa17b9 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4717 Removed old refernece to BuildUrl, added buildnumber from Jenkins

parent 455d38a5
Branches
Tags
No related merge requests found
...@@ -47,6 +47,7 @@ pipeline { ...@@ -47,6 +47,7 @@ pipeline {
} }
configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) {
sh 'mvn -s $MAVEN_SETTINGS versions:set-property -Dproperty="build.number" -DnewVersion=${currentBuild.number}'
sh 'mvn -s $MAVEN_SETTINGS clean install -Dmaven.wagon.http.retryHandler.count=3 -DelasticTests.disabled=true' sh 'mvn -s $MAVEN_SETTINGS clean install -Dmaven.wagon.http.retryHandler.count=3 -DelasticTests.disabled=true'
} }
} }
......
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<name>Administration</name> <name>Administration</name>
<description>Administration Backend Project</description> <description>Administration Backend Project</description>
<properties>
<build.number>?</build.number>
</properties>
<dependencies> <dependencies>
<!-- Spring --> <!-- Spring -->
<dependency> <dependency>
...@@ -79,6 +82,11 @@ ...@@ -79,6 +82,11 @@
<goals> <goals>
<goal>build-info</goal> <goal>build-info</goal>
</goals> </goals>
<configuration>
<additionalProperties>
<number>${build.number}</number>
</additionalProperties>
</configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
......
...@@ -18,18 +18,14 @@ class RootService { ...@@ -18,18 +18,14 @@ class RootService {
} }
public Instant getBuildTime() { public Instant getBuildTime() {
return buildProperties.map(BuildProperties::getTime).orElse(Instant.now()); return buildProperties.map(BuildProperties::getTime).orElse(null);
} }
public String getJavaVersion() { public String getJavaVersion() {
return System.getProperty("java.version", "?"); return System.getProperty("java.version");
} }
public String getBuildNumber() { public String getBuildNumber() {
return buildProperties.map(p -> p.get("number")).orElse("?"); return buildProperties.map(p -> p.get("number")).orElse("?");
} }
public String getBuildUrl() {
return buildProperties.map(p -> p.get("url")).orElse("?");
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment