When running "war" command from Grails, I want to store the build commit for use it in a GSP thereafter.
In my Config.groovy
def proc = 'git rev-parse HEAD'.execute()
proc.waitFor()
build_commit.number = proc.in.text
In my GSP
<p>${grailsApplication.config.build_commit.number}</p>
Everything work fine when I run my app with "run app" command but when I deploy my War on Tomcat the information is no longer available.
Is it because Config.groovy is reevaluate when the war is deploy ?
I also try to write programmatically the build commit to application.properties but I couldn't find a way to do that.. If it's possible, I also need to know how to detect a Tomcat env for avoid rewriting a blank value.
Any help will be appreciate.