Skip to content

Commit

Permalink
Tweak gradle check
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon committed Nov 10, 2022
1 parent 27afabb commit 6b702f5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions jenkins/gradle/gradle-check.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,16 @@ pipeline {
fi
"""

def agent_name = params.AGENT_LABEL.tokenize('-')[2]

if (env.USER_BUILD_CAUSE.equals('[]') && env.TIMER_BUILD_CAUSE.equals('[]')) {
def pr_url = "${pr_to_clone_url}".replace(".git", "/pull/${pr_number}")
println("Triggered by GitHub: ${pr_to_clone_url}")
if ("$pr_number" == "Null") {
currentBuild.description = """runner: ${AGENT_LABEL}<br><a href="${pr_to_clone_url}">Others</a>: ${pr_title}"""
currentBuild.description = """runner: ${agent_name}<br><a href="${pr_to_clone_url}">Others</a>: ${pr_title}"""
}
else {
currentBuild.description = """runner: ${AGENT_LABEL}<br><a href="${pr_url}">PR #${pr_number}</a>: ${pr_title}"""
currentBuild.description = """runner: ${agent_name}<br><a href="${pr_url}">PR #${pr_number}</a>: ${pr_title}"""
}

runGradleCheck(
Expand All @@ -107,7 +109,7 @@ pipeline {
else {
println("Triggered by User or Triggered by Timer")
def repo_url = "${GIT_REPO_URL}".replace(".git", "/commit")
currentBuild.description = """runner: ${AGENT_LABEL}<br>git: <a href="${GIT_REPO_URL}">${GIT_REPO_URL}</a><br>ref: <a href="${repo_url}/${GIT_REFERENCE}">${GIT_REFERENCE}</a>"""
currentBuild.description = """runner: ${agent_name}<br>git: <a href="${GIT_REPO_URL}">${GIT_REPO_URL}</a><br>ref: <a href="${repo_url}/${GIT_REFERENCE}">${GIT_REFERENCE}</a>"""

runGradleCheck(
gitRepoUrl: "${GIT_REPO_URL}",
Expand Down

0 comments on commit 6b702f5

Please sign in to comment.