Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add latest url update toggle on distribution workflows #2881

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = """<a href="${pr_to_clone_url}">Others</a>: ${pr_title}<br>runner: ${AGENT_LABEL}"""
currentBuild.description = """runner: ${agent_name}<br><a href="${pr_to_clone_url}">Others</a>: ${pr_title}"""
}
else {
currentBuild.description = """<a href="${pr_url}">PR #${pr_number}</a>: ${pr_title}<br>runner: ${AGENT_LABEL}"""
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 = """git: <a href="${GIT_REPO_URL}">${GIT_REPO_URL}</a><br>ref: <a href="${repo_url}/${GIT_REFERENCE}">${GIT_REFERENCE}</a><br>runner: ${AGENT_LABEL}"""
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
13 changes: 10 additions & 3 deletions jenkins/opensearch-dashboards/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ pipeline {
description: 'Build docker image or not with options.',
choices: ['build_docker', 'build_docker_with_build_number_tag', 'do_not_build_docker'],
)
booleanParam(
name: 'UPDATE_LATEST_URL',
description: 'Update latest url so /latest/ is pointed to this build',
defaultValue: true
)
booleanParam(
name: 'PUBLISH_NOTIFICATION',
description: 'Publish the status of this build job or not.',
Expand Down Expand Up @@ -614,9 +619,11 @@ pipeline {
}
steps {
script {
uploadIndexFile(
indexFilePath: env.INDEX_FILE_PATH
)
if (params.UPDATE_LATEST_URL) {
uploadIndexFile(
indexFilePath: env.INDEX_FILE_PATH
)
}
}
}
}
Expand Down
13 changes: 10 additions & 3 deletions jenkins/opensearch/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ pipeline {
description: 'Build docker image or not with options.',
choices: ['build_docker', 'build_docker_with_build_number_tag', 'do_not_build_docker'],
)
booleanParam(
name: 'UPDATE_LATEST_URL',
description: 'Update latest url so /latest/ is pointed to this build',
defaultValue: true
)
booleanParam(
name: 'PUBLISH_NOTIFICATION',
description: 'Publish the status of this build job or not.',
Expand Down Expand Up @@ -786,9 +791,11 @@ pipeline {
}
steps {
script {
uploadIndexFile(
indexFilePath: env.INDEX_FILE_PATH
)
if (params.UPDATE_LATEST_URL) {
uploadIndexFile(
indexFilePath: env.INDEX_FILE_PATH
)
}
}
}
}
Expand Down