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

Milestone1 jan 2025 #257

Open
wants to merge 16 commits into
base: ibm
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Check out [Adopt's guide](docs/UsingOurScripts.md) to setting up your own script
## I want to build code from my own fork/branch of openjdk in jenkins

You will need to add some parameters to the `BUILD_ARGS` on the individual
platform-specific pipeline (or `additionalBuildArgs` if runnibg a top level pipeline) and
platform-specific pipeline (or `additionalBuildArgs` if running a top level pipeline) and
specify `--disable-adopt-branch-safety` for example:

`--disable-adopt-branch-safety -r https://github.com/sxa/openjdk-jdk11u -b mybranch`
54 changes: 39 additions & 15 deletions pipelines/build/common/build_base_file.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -780,19 +780,25 @@ class Builder implements Serializable {
/*
Call job to push artifacts to github. Usually it's only executed on a nightly build
*/
def publishBinary(IndividualBuildConfig config=null) {
def publishBinary(IndividualBuildConfig config=null, String jobResult, String jobUrl) {
def timestamp = new Date().format('yyyy-MM-dd-HH-mm', TimeZone.getTimeZone('UTC'))
def javaVersion=determineReleaseToolRepoVersion()
def stageName = 'BETA publish'
def releaseComment = 'BETA publish'
def releaseWarning = ''
if ( jobResult != "SUCCESS" && jobResult != "UNSTABLE" ) {
// Build was not successful, add warning and link to build job
releaseWarning = '<a href=' + jobUrl + '><span style="color:red;">WARNING: pipeline status was <b>' + jobResult + '</b></span></a> : '
}

def tag = "${javaToBuild}-${timestamp}"
if (publishName) {
tag = publishName
}
def osArch = 'all available OS&ARCHs'
def artifactsToCopy = '**/temurin/*.tar.gz,**/temurin/*.zip,**/temurin/*.sha256.txt,**/temurin/*.msi,**/temurin/*.pkg,**/temurin/*.json,**/temurin/*.sig'
def dryRun = false
def String releaseToolUrl = "${context.HUDSON_URL}job/build-scripts/job/release/job/refactor_openjdk_release_tool/parambuild?"
String releaseToolUrl = "${context.JENKINS_URL}job/build-scripts/job/release/job/refactor_openjdk_release_tool/parambuild?"
if ( config != null ) {
def prefixOfArtifactsToCopy = "**/${config.TARGET_OS}/${config.ARCHITECTURE}/${config.VARIANT}"
artifactsToCopy = "${prefixOfArtifactsToCopy}/*.tar.gz,${prefixOfArtifactsToCopy}/*.zip,${prefixOfArtifactsToCopy}/*.sha256.txt,${prefixOfArtifactsToCopy}/*.msi,${prefixOfArtifactsToCopy}/*.pkg,${prefixOfArtifactsToCopy}/*.json,${prefixOfArtifactsToCopy}/*.sig"
Expand Down Expand Up @@ -832,7 +838,7 @@ class Builder implements Serializable {
releaseToolUrl += "&TAG=${tag}&UPSTREAM_JOB_NAME=${urlJobName}&ARTIFACTS_TO_COPY=${artifactsToCopy}"

context.echo "return releaseToolUrl is ${releaseToolUrl}"
return ["${releaseToolUrl}", "${releaseComment}"]
return ["${releaseToolUrl}", "${releaseComment}", "${releaseWarning}"]
}

/*
Expand Down Expand Up @@ -1244,17 +1250,20 @@ class Builder implements Serializable {
flatten: true,
optional: true
)
// Archive tap files as a single tar file
context.sh """
cd ${tarDir}/
tar -czf ${tarTap} *.tap
"""
try {
context.timeout(time: pipelineTimeouts.ARCHIVE_ARTIFACTS_TIMEOUT, unit: 'HOURS') {
context.archiveArtifacts artifacts: "${tarDir}/${tarTap}"
// Archive tap files as a single tar file if we have any
def tapExists = context.sh(script: "ls -l ${tarDir}/*.tap", returnStatus:true)
if (tapExists == 0) {
context.sh """
cd ${tarDir}/
tar -czf ${tarTap} *.tap
"""
try {
context.timeout(time: pipelineTimeouts.ARCHIVE_ARTIFACTS_TIMEOUT, unit: 'HOURS') {
context.archiveArtifacts artifacts: "${tarDir}/${tarTap}"
}
} catch (FlowInterruptedException e) {
throw new Exception("[ERROR] Archive AQAvitTapFiles.tar.gz timeout Exiting...")
}
} catch (FlowInterruptedException e) {
throw new Exception("[ERROR] Archive AQAvitTapFiles.tar.gz timeout Exiting...")
}
}
}
Expand All @@ -1264,11 +1273,26 @@ class Builder implements Serializable {
if (publish || release) {
if (release) {
context.println 'NOT PUBLISHING RELEASE AUTOMATICALLY, PLEASE SEE THE RERUN RELEASE PUBLISH BINARIES LINKS'
if (context.JENKINS_URL.contains('adoptium')) {
releaseSummary.appendText('</ul>', false)
releaseSummary.appendText("<b>TAP files COLLECTION and RELEASE:</b><ul>")
def urlJobName = URLEncoder.encode("${env.JOB_NAME}", 'UTF-8')
def tapCollectionUrl = "${context.JENKINS_URL}job/TAP_Collection/parambuild?Release_PipelineJob_Name=${urlJobName}"
releaseSummary.appendText("<li><a href=${tapCollectionUrl}> RELEASE TAPs COLLECTION</a></li>")
String releaseToolUrl = "${context.JENKINS_URL}job/build-scripts/job/release/job/refactor_openjdk_release_tool/parambuild?RELEASE=${release}}&UPSTREAM_JOB_NAME=TAP_Collection&UPLOAD_TESTRESULTS_ONLY=true&dryrun=false"
def tag = publishName
tag = URLEncoder.encode(tag, 'UTF-8')
def artifactsToCopy = '**/AQAvitTapFiles.tar.gz'
artifactsToCopy = URLEncoder.encode(artifactsToCopy, 'UTF-8')
def javaVersion=determineReleaseToolRepoVersion()
releaseToolUrl += "&VERSION=${javaVersion}&TAG=${tag}&ARTIFACTS_TO_COPY=${artifactsToCopy}"
releaseSummary.appendText("<li><a href=${releaseToolUrl}> RELEASE TEST RESULTS TAPs Link</a></li>")
}
} else {
try {
context.timeout(time: pipelineTimeouts.PUBLISH_ARTIFACTS_TIMEOUT, unit: 'HOURS') {
def (String releaseToolUrl, String releaseComment) = publishBinary()
releaseSummary.appendText("<li><a href=${releaseToolUrl}> ${releaseComment} Rerun Link</a></li>")
def (String releaseToolUrl, String releaseComment, String releaseWarning) = publishBinary(null, currentBuild.result, "${context.BUILD_URL}")
releaseSummary.appendText("<li>${releaseWarning}<a href=${releaseToolUrl}> ${releaseComment} Rerun Link</a></li>")
}
} catch (FlowInterruptedException e) {
throw new Exception("[ERROR] Publish binary timeout (${pipelineTimeouts.PUBLISH_ARTIFACTS_TIMEOUT} HOURS) has been reached OR the downstream publish job failed. Exiting...")
Expand Down
Loading
Loading