Use actual current commit id for build scan custom value (#52487)

This commit is contained in:
Mark Vieira 2020-02-18 16:24:06 -08:00
parent a99d8b71b1
commit 3e3d80e1c8
No known key found for this signature in database
GPG Key ID: CA947EF7E6D4B105
1 changed files with 3 additions and 8 deletions

View File

@ -1,4 +1,5 @@
import org.elasticsearch.gradle.OS
import org.elasticsearch.gradle.info.BuildParams
import org.gradle.initialization.BuildRequestMetaData
import java.util.concurrent.TimeUnit
@ -76,14 +77,8 @@ buildScan {
value 'Git Branch', branch
tag branch
}
if (System.getenv('GIT_COMMIT')) {
value 'Git Commit ID', System.getenv('GIT_COMMIT')
link 'Source', "https://github.com/elastic/elasticsearch/tree/${System.getenv('GIT_COMMIT')}"
background {
def changes = "git diff --name-only ${System.getenv('GIT_PREVIOUS_COMMIT')}..${System.getenv('GIT_COMMIT')}".execute().text.trim()
value 'Git Changes', changes
}
}
value 'Git Commit ID', BuildParams.gitRevision
link 'Source', "https://github.com/elastic/elasticsearch/tree/${BuildParams.gitRevision}"
}
} else {
tag 'LOCAL'