From ae2e84baa57fc516f134aa65482ee6d94e791ca2 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Mon, 12 Feb 2024 15:24:10 -0500 Subject: [PATCH 1/2] Rebase Signed-off-by: Sophia Guo --- pipelines/build/common/build_base_file.groovy | 53 +++++++++++++++---- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/pipelines/build/common/build_base_file.groovy b/pipelines/build/common/build_base_file.groovy index 4791a1532..d4dfeec73 100644 --- a/pipelines/build/common/build_base_file.groovy +++ b/pipelines/build/common/build_base_file.groovy @@ -770,11 +770,6 @@ class Builder implements Serializable { Call job to push artifacts to github. Usually it's only executed on a nightly build */ def publishBinary() { - if (release) { - // make sure to skip on release - context.println('Not publishing release') - return - } def timestamp = new Date().format('yyyy-MM-dd-HH-mm', TimeZone.getTimeZone('UTC')) def tag = "${javaToBuild}-${timestamp}" @@ -784,8 +779,8 @@ class Builder implements Serializable { } context.stage('publish') { - context.println "publishing with publishName: ${publishName}" - context.build job: 'build-scripts/release/refactor_openjdk_release_tool', + context.println "publishing with publishName: ${publishName}" + context.build job: 'build-scripts/release/refactor_openjdk_release_tool', parameters: [ ['$class': 'BooleanParameterValue', name: 'RELEASE', value: release], ['$class': 'BooleanParameterValue', name: 'DRY_RUN', value: false], @@ -798,6 +793,41 @@ class Builder implements Serializable { } } + /* + Call job to dry run Release Publish, generate release publish jenkins link + */ + def dryrunReleasePublish(IndividualBuildConfig config) { + def javaVersion=determineReleaseToolRepoVersion() + context.stage('Dry run release publish') { + def prefixOfArtifactsToCopy = "**/${config.TARGET_OS}/${config.ARCHITECTURE}/${config.VARIANT}" + def artifactsToCopy = "${prefixOfArtifactsToCopy}/*.tar.gz,${prefixOfArtifactsToCopy}/*.zip,${prefixOfArtifactsToCopy}/*.sha256.txt,${prefixOfArtifactsToCopy}/*.msi,${prefixOfArtifactsToCopy}/*.pkg,${prefixOfArtifactsToCopy}/*.json,${prefixOfArtifactsToCopy}/*.sig" + context.println "Dry run publishing : ${publishName} ${config.TARGET_OS} ${config.ARCHITECTURE}" + def releaseJob = context.build job: 'build-scripts/release/refactor_openjdk_release_tool', + parameters: [ + ['$class': 'BooleanParameterValue', name: 'RELEASE', value: release], + ['$class': 'BooleanParameterValue', name: 'DRY_RUN', value: true], + context.string(name: 'TAG', value: publishName), + context.string(name: 'UPSTREAM_JOB_NAME', value: env.JOB_NAME), + context.string(name: 'UPSTREAM_JOB_NUMBER', value: "${currentBuild.getNumber()}"), + context.string(name: 'ARTIFACTS_TO_COPY', value: "${artifactsToCopy}"), + context.string(name: 'ARTIFACTS_TO_SKIP', value: '**/*testimage*'), + context.string(name: 'VERSION', value: javaVersion) + ] + String releaseToolUrl = "${HUDSON_URL}job/build-scripts/job/release/job/refactor_openjdk_release_tool/parambuild?" + // pulbish release link - if dry run succeeds the link to ready to publish, if dry run fails the link is dry run link + releaseToolUrl += "VERSION=${javaVersion}&TAG=${publishName}&RELEASE=true&UPSTREAM_JOB_NAME=${env.JOB_NAME}&UPSTREAM_JOB_NUMBER=${currentBuild.getNumber()}&ARTIFACTS_TO_COPY=${artifactsToCopy}&ARTIFACTS_TO_SKIP=**/*testimage*" + def releaseComment = "Release Publish" + if (releaseJob.getResult()) { + releaseToolUrl += "&DRY_RUN=false" + releaseComment = "Dry run release publish" + } else { + releaseToolUrl += "&DRY_RUN=true" + } + URLEncoder.encode(releaseToolUrl.toString(), "UTF-8") + return ["${releaseToolUrl}", "${releaseComment}"] + } + } + /* Main function. This is what is executed remotely via the [release-|evaluation-]openjdkxx-pipeline and pr-tester jobs Running in the *openjdkX-pipeline @@ -843,6 +873,9 @@ class Builder implements Serializable { context.echo "Force auto generate AQA test jobs: ${aqaAutoGen}" context.echo "Keep test reportdir: ${keepTestReportDir}" context.echo "Keep release logs: ${keepReleaseLogs}" + def releaseSummary = manager.createSummary('next.svg') + releaseSummary.appendText('RELEASE PUBLISH BINARIES:', false) // publish to github if needed // Don't publish release automatically if (publish && !release) { From a0d1f6feb999422ce9576e0c405396b6507b00c7 Mon Sep 17 00:00:00 2001 From: sophia-guo Date: Tue, 13 Feb 2024 11:37:40 -0500 Subject: [PATCH 2/2] Update pipelines/build/common/build_base_file.groovy Co-authored-by: Shelley Lambert --- pipelines/build/common/build_base_file.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines/build/common/build_base_file.groovy b/pipelines/build/common/build_base_file.groovy index d4dfeec73..7dd5ff62d 100644 --- a/pipelines/build/common/build_base_file.groovy +++ b/pipelines/build/common/build_base_file.groovy @@ -814,7 +814,7 @@ class Builder implements Serializable { context.string(name: 'VERSION', value: javaVersion) ] String releaseToolUrl = "${HUDSON_URL}job/build-scripts/job/release/job/refactor_openjdk_release_tool/parambuild?" - // pulbish release link - if dry run succeeds the link to ready to publish, if dry run fails the link is dry run link + // publish release link - if dry run succeeds the link to ready to publish, if dry run fails the link is dry run link releaseToolUrl += "VERSION=${javaVersion}&TAG=${publishName}&RELEASE=true&UPSTREAM_JOB_NAME=${env.JOB_NAME}&UPSTREAM_JOB_NUMBER=${currentBuild.getNumber()}&ARTIFACTS_TO_COPY=${artifactsToCopy}&ARTIFACTS_TO_SKIP=**/*testimage*" def releaseComment = "Release Publish" if (releaseJob.getResult()) {