git.dirty=true
git.commit.time=24.01.2017 @ 07\:08\:22 MST
git.branch=master
git.commit.id=79b91f49b53eab5fe96efd2a2d9438ea3e3a0d00
git.tags=
The git.dirty indicates there are uncommitted changes in git. This build should never be dirty since if it is the commit hash does not reflect what was built. I believe you can fail the build if dirty. With web apps it's easy to expose this information via an endpoint. Also a good practice is to print the contents of the file to a log on start-up. Big tip of the hat goes to Konrad Malawski (akka core developer) for developing this plugin.
<plugin> <groupId>pl.project13.maven</groupId> <artifactId>git-commit-id-plugin</artifactId> <version>2.2.1</version> <executions> <execution> <id>get-the-git-infos</id> <goals> <goal>revision</goal> </goals> </execution> <execution> <id>validate-the-git-infos</id> <goals> <goal>revision</goal> </goals> <phase>package</phase> </execution> </executions> <configuration> <generateGitPropertiesFile>true</generateGitPropertiesFile> <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename> <excludeProperties> <excludeProperty>git.build.*</excludeProperty> <excludeProperty>git.commit.user.email</excludeProperty> <excludeProperty>git.commit.message.*</excludeProperty> <excludeProperty>git.commit.id.describe</excludeProperty> <excludeProperty>git.commit.user.name</excludeProperty> <excludeProperty>git.remote.origin.url</excludeProperty> <excludeProperty>git.commit.id.abbrev</excludeProperty> <excludeProperty>git.closest.tag.name</excludeProperty> <excludeProperty>git.closest.tag.commit.count</excludeProperty> <excludeProperty>git.remote.origin.url</excludeProperty> </excludeProperties> </configuration> </plugin>
No comments:
Post a Comment