Created
November 17, 2016 14:40
-
-
Save blackpioter/cffce0726f4510307277b8da2d877bb0 to your computer and use it in GitHub Desktop.
RPM metadata from git repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id "com.palantir.git-version" version "0.5.2" | |
id "nebula.rpm" version "4.1.0" | |
} | |
jar { | |
baseName = 'PACKAGE_NAME' | |
try { | |
def details = versionDetails() | |
manifest { | |
attributes( | |
'Velocity-Git-Hash': details.gitHash, | |
'Velocity-Last-Tag': details.lastTag, | |
'Velocity-Commit-Distance': details.commitDistance, | |
'Velocity-Created-At': java.time.Instant.now().toEpochMilli() | |
) | |
} | |
} catch (IllegalArgumentException e) { | |
// Do nothing as there is probably no repo (don't care while migrations are done) | |
System.println("No repo found, cannot add data to manifest") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment