From c317db110f2886395c3919b0bb88aac683c233e4 Mon Sep 17 00:00:00 2001 From: xurror Date: Tue, 21 Apr 2020 16:47:34 +0100 Subject: [PATCH] FINERACT-883 Display fineracts git build info actuator/info endpoint --- fineract-provider/.gitignore | 1 + fineract-provider/build.gradle | 30 +++++++++++++++++-- .../basicauth/application.properties | 1 + .../twofactor/application.properties | 1 + .../properties/oauth/application.properties | 1 + .../oauth/twofactor/application.properties | 1 + .../src/main/resources/application.properties | 1 + 7 files changed, 33 insertions(+), 3 deletions(-) diff --git a/fineract-provider/.gitignore b/fineract-provider/.gitignore index e4bae8609..011882799 100644 --- a/fineract-provider/.gitignore +++ b/fineract-provider/.gitignore @@ -1,6 +1,7 @@ bin out/ build +src/main/resources/git.properties repos .classpath .project diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index d6982f8ad..746898b99 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -49,6 +49,7 @@ buildscript { // See: https://github.com/spotbugs/spotbugs-gradle-plugin/issues/128#issuecomment-535864882 classpath 'com.google.guava:guava:28.1-jre' classpath "gradle.plugin.com.github.andygoossens:gradle-modernizer-plugin:1.3.0" + classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.2.2" } } @@ -68,6 +69,7 @@ apply plugin: "com.github.spotbugs" apply plugin: 'checkstyle' apply plugin: 'com.github.andygoossens.gradle-modernizer-plugin' apply plugin: 'jacoco' +apply plugin: "com.gorylenko.gradle-git-properties" // apply plugin: 'pmd' dependencyManagement { @@ -250,8 +252,8 @@ rat { //BSD License '**/assets/uglify.js', - //Ignore out folder - '**/out/**' + //Ignore out folder + '**/out/**', ] } @@ -403,7 +405,15 @@ war { license { header rootProject.file('../APACHE_LICENSETEXT.md') - excludes(["**/*.html", "**/*.mustache", "**/package-info.java", "**/keystore.jks", "**/swagger-ui/**"]) + excludes([ + "**/rat-report.txt", + "**/git.properties", + "**/*.html", + "**/*.mustache", + "**/package-info.java", + "**/keystore.jks", + "**/swagger-ui/**", + ]) strictCheck true } @@ -557,6 +567,7 @@ def qualifyVersionIfNecessary(version) { springBoot { mainClassName = 'org.apache.fineract.ServerWithMariaDB4jApplication' } + bootWar { mainClassName = 'org.apache.fineract.ServerWithMariaDB4jApplication' } @@ -567,3 +578,16 @@ tasks.withType(SpotBugsTask) { reports.html.enabled = true reportLevel = "high" } + +gitProperties { + gitPropertiesResourceDir = "${project.rootDir}/src/main/resources" + dateFormat = "yyyy-MM-dd'T'HH:mmZ" + dateFormatTimeZone = "GMT" +} + +generateGitProperties.outputs.upToDateWhen { false } + +clean { + delete "${project.rootDir}/src/main/resources/git.properties" +} + diff --git a/fineract-provider/properties/basicauth/application.properties b/fineract-provider/properties/basicauth/application.properties index b1f6aea78..a6f669274 100644 --- a/fineract-provider/properties/basicauth/application.properties +++ b/fineract-provider/properties/basicauth/application.properties @@ -19,3 +19,4 @@ spring.profiles.default=basicauth management.health.jms.enabled=false +management.info.git.mode=FULL diff --git a/fineract-provider/properties/basicauth/twofactor/application.properties b/fineract-provider/properties/basicauth/twofactor/application.properties index b748491a7..59bd126aa 100644 --- a/fineract-provider/properties/basicauth/twofactor/application.properties +++ b/fineract-provider/properties/basicauth/twofactor/application.properties @@ -20,3 +20,4 @@ spring.profiles.default=basicauth spring.profiles.active=basicauth,twofactor management.health.jms.enabled=false +management.info.git.mode=FULL diff --git a/fineract-provider/properties/oauth/application.properties b/fineract-provider/properties/oauth/application.properties index b34050a5b..d958ec715 100644 --- a/fineract-provider/properties/oauth/application.properties +++ b/fineract-provider/properties/oauth/application.properties @@ -20,3 +20,4 @@ spring.profiles.default=basicauth spring.profiles.active=oauth management.health.jms.enabled=false +management.info.git.mode=FULL diff --git a/fineract-provider/properties/oauth/twofactor/application.properties b/fineract-provider/properties/oauth/twofactor/application.properties index 3164fff97..1a2c979ce 100644 --- a/fineract-provider/properties/oauth/twofactor/application.properties +++ b/fineract-provider/properties/oauth/twofactor/application.properties @@ -20,3 +20,4 @@ spring.profiles.default=basicauth spring.profiles.active=oauth,twofactor management.health.jms.enabled=false +management.info.git.mode=FULL diff --git a/fineract-provider/src/main/resources/application.properties b/fineract-provider/src/main/resources/application.properties index b1f6aea78..a6f669274 100644 --- a/fineract-provider/src/main/resources/application.properties +++ b/fineract-provider/src/main/resources/application.properties @@ -19,3 +19,4 @@ spring.profiles.default=basicauth management.health.jms.enabled=false +management.info.git.mode=FULL