-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuildScan.gradle
More file actions
31 lines (25 loc) · 1021 Bytes
/
buildScan.gradle
File metadata and controls
31 lines (25 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
def boolean isTravisCIServerBuild = System.getenv('TRAVIS')
buildScan.publishAlwaysIf(isTravisCIServerBuild)
if (isTravisCIServerBuild)
{
def pullRequestNumber = System.getenv('TRAVIS_PULL_REQUEST')
def boolean isPullRequest = pullRequestNumber != 'false'
if (hasProperty('releaseVersion'))
buildScan.tag 'RELEASE'
else {
if (isPullRequest)
{
buildScan.tag 'Pull Request'
buildScan.value 'Git Pull Request Branch', System.getenv('TRAVIS_PULL_REQUEST_BRANCH')
}
else
buildScan.tag 'Commit Check'
}
def travisBuildId = System.getenv('TRAVIS_BUILD_ID')
buildScan.link 'Github Project URL', githubProjectUrl
buildScan.value 'Git Branch Name', System.getenv('TRAVIS_BRANCH')
buildScan.value 'Git Commit Id', System.getenv('TRAVIS_COMMIT')
buildScan.link 'Travis Build URL', "$travisProjectUrl/builds/$travisBuildId"
buildScan.value 'Travis Build Number', System.getenv('TRAVIS_BUILD_NUMBER')
buildScan.value 'Build Trigger Event', System.getenv('TRAVIS_EVENT_TYPE')
}