Skip to content

Commit 103f38c

Browse files
committed
Use updated environment variable for branch build scan metadata
1 parent eea1c74 commit 103f38c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

gradle/build-scan.gradle

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ buildScan {
5252
link 'CI Build', buildUrl
5353
link 'GCP Upload', "https://console.cloud.google.com/storage/browser/_details/elasticsearch-ci-artifacts/jobs/${URLEncoder.encode(jobName, "UTF-8")}/build/${buildNumber}.tar.bz2"
5454
value 'Job Number', buildNumber
55+
value 'Git Branch', System.getenv('JOB_BRANCH')
56+
tag System.getenv('JOB_BRANCH')
5557

5658
System.getenv().getOrDefault('NODE_LABELS', '').split(' ').each {
5759
value 'Jenkins Worker Label', it
@@ -61,18 +63,11 @@ buildScan {
6163
def isPrBuild = System.getenv('ROOT_BUILD_CAUSE_GHPRBCAUSE') != null
6264
if (isPrBuild) {
6365
value 'Git Commit ID', System.getenv('ghprbActualCommit')
64-
value 'Git Branch', System.getenv('ghprbTargetBranch')
65-
tag System.getenv('ghprbTargetBranch')
6666
tag "pr/${System.getenv('ghprbPullId')}"
6767
tag 'pull-request'
6868
link 'Source', "https://github.com/elastic/elasticsearch/tree/${System.getenv('ghprbActualCommit')}"
6969
link 'Pull Request', System.getenv('ghprbPullLink')
7070
} else {
71-
if (System.getenv('GIT_BRANCH')) {
72-
def branch = System.getenv('GIT_BRANCH').split('/').last()
73-
value 'Git Branch', branch
74-
tag branch
75-
}
7671
if (System.getenv('GIT_COMMIT')) {
7772
value 'Git Commit ID', System.getenv('GIT_COMMIT')
7873
link 'Source', "https://github.com/elastic/elasticsearch/tree/${System.getenv('GIT_COMMIT')}"

0 commit comments

Comments
 (0)