Created
October 22, 2018 21:05
-
-
Save indyfromoz/bc3b9afa07988ff15ec6cc097282ac12 to your computer and use it in GitHub Desktop.
Build identifiers
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
ext { | |
// Assumes Git is in your PATH | |
commitCount = { | |
return 'git rev-list --count HEAD'.execute().text.trim() | |
} | |
gitSha = { | |
return 'git rev-parse --short HEAD'.execute().text.trim() | |
} | |
buildTimestamp = { | |
def df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'") | |
df.setTimeZone(TimeZone.getTimeZone("UTC")) | |
return df.format(new Date()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment