Skip to content

Commit

Permalink
Update gradle publish library to handle invokeType
Browse files Browse the repository at this point in the history
Signed-off-by: Prudhvi Godithi <[email protected]>
  • Loading branch information
prudhvigodithi committed May 14, 2024
1 parent e9deb80 commit a25df89
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions jenkins/gradle/gradle-check.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]))
Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit a25df89

Please sign in to comment.