Allow build on systems without git (#2514)
Set git revision to "unknown" if git not available.
This commit is contained in:
parent
0f1e95d0ca
commit
4159826f26
|
@ -7,9 +7,13 @@ apply from: "../instance-build.gradle"
|
||||||
|
|
||||||
def getGitSha = {
|
def getGitSha = {
|
||||||
def stdout = new ByteArrayOutputStream()
|
def stdout = new ByteArrayOutputStream()
|
||||||
exec {
|
try {
|
||||||
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
exec {
|
||||||
standardOutput = stdout
|
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
||||||
|
standardOutput = stdout
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
return "unknown"
|
||||||
}
|
}
|
||||||
return stdout.toString().trim()
|
return stdout.toString().trim()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue