-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update gradle publish library to handle invokeType
Signed-off-by: Prudhvi Godithi <[email protected]>
- Loading branch information
1 parent
e9deb80
commit a25df89
Showing
1 changed file
with
26 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
* compatible open source license. | ||
*/ | ||
|
||
lib = library(identifier: '[email protected].2', retriever: modernSCM([ | ||
lib = library(identifier: '[email protected].6', retriever: modernSCM([ | ||
$class: 'GitSCMSource', | ||
remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git', | ||
])) | ||
|
@@ -147,7 +147,31 @@ pipeline { | |
junit allowEmptyResults: true, testResults: '**/build/test-results/**/*.xml' | ||
archiveArtifacts artifacts: 'codeCoverage.xml', onlyIfSuccessful: true | ||
script { | ||
publishGradleCheckTestResults(prNumber: "${pr_number}", prDescription: "${pr_title}") | ||
def invokedBy | ||
def pullRequest | ||
def pullRequestTitle | ||
switch (true) { | ||
case env.BUILD_CAUSE.contains('Started by user'): | ||
invokedBy = 'User' | ||
pullRequest = "${GIT_REFERENCE}" | ||
pullRequestTitle = "Null" | ||
break | ||
case env.BUILD_CAUSE.contains('Started by timer'): | ||
invokedBy = 'Timer' | ||
pullRequest = "${GIT_REFERENCE}" | ||
pullRequestTitle = "Null" | ||
break | ||
case "${pr_number}" == "Null": | ||
invokedBy = 'Post Merge Action' | ||
pullRequest = "${GIT_REFERENCE}" | ||
pullRequestTitle = "${pr_title}" | ||
break | ||
default: | ||
invokedBy = 'Pull Request' | ||
pullRequest = "${pr_number}" | ||
pullRequestTitle = "${pr_title}" | ||
} | ||
publishGradleCheckTestResults(prNumber: "${pullRequest}" , prDescription: "${pr_title}", invokeType: "${invokedBy}") | ||
sh("rm -rf *") | ||
postCleanup() | ||
} | ||
|