Skip to content

Commit

Permalink
Pass OpenJCEPlus Branch to the build scripts
Browse files Browse the repository at this point in the history
Also add ability to override openjceplus branch at build launch

Signed-off-by: Adam Brousseau <[email protected]>
  • Loading branch information
AdamBrousseau committed May 14, 2024
1 parent e521151 commit 8b959f6
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 1 deletion.
7 changes: 7 additions & 0 deletions pipelines/build/common/build_base_file.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ class Builder implements Serializable {
RELEASE: release,
WEEKLY: isWeekly,
PUBLISH_NAME: publishName,
OPENJCEPLUS_BRANCH: openjceplusBranch,
ADOPT_BUILD_NUMBER: adoptBuildNumber,
ENABLE_REPRODUCIBLE_COMPARE: enableReproducibleCompare,
ENABLE_TESTS: enableTests,
Expand Down Expand Up @@ -1268,6 +1269,7 @@ return {
String aqaReference,
String aqaAutoGen,
String overridePublishName,
String overrideOpenJCEPlusBranch,
String useAdoptShellScripts,
String additionalConfigureArgs,
def scmVars,
Expand Down Expand Up @@ -1308,6 +1310,11 @@ return {
}
}

String openjceplusBranch = ''
if (overrideOpenJCEPlusBranch) {
openjceplusBranch = overrideOpenJCEPlusBranch
}

def buildsExcludeDocker = [:]
if (dockerExcludes != '' && dockerExcludes != null) {
buildsExcludeDocker = new JsonSlurper().parseText(dockerExcludes) as Map
Expand Down
1 change: 1 addition & 0 deletions pipelines/build/common/config_regeneration.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ class Regeneration implements Serializable {
RELEASE: false,
WEEKLY: false,
PUBLISH_NAME: '',
OPENJCEPLUS_BRANCH: '',
ADOPT_BUILD_NUMBER: '',
ENABLE_REPRODUCIBLE_COMPARE: enableReproducibleCompare,
ENABLE_TESTS: DEFAULTS_JSON['testDetails']['enableTests'] as Boolean,
Expand Down
1 change: 1 addition & 0 deletions pipelines/build/common/create_job_from_template.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ pipelineJob("$buildFolder/$JOB_NAME") {
<dt><strong>USE_ADOPT_SHELL_SCRIPTS</strong></dt><dd>Use Adopt's make-adopt-build-farm.sh and other bash scripts</dd>
<dt><strong>RELEASE</strong></dt><dd>Is this build a release</dd>
<dt><strong>PUBLISH_NAME</strong></dt><dd>Set name of publish</dd>
<dt><strong>OPENJCEPLUS_BRANCH</strong></dt><dd>Explicitly set name of the OpenJCEPlus branch to checkout</dd>
<dt><strong>ADOPT_BUILD_NUMBER</strong></dt><dd>Adopt build number</dd>
<dt><strong>ENABLE_REPRODUCIBLE_COMPARE</strong></dt><dd>Run reproducible compare build</dd>
<dt><strong>ENABLE_TESTS</strong></dt><dd>Run tests</dd>
Expand Down
12 changes: 11 additions & 1 deletion pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,17 @@ class Build {
}
def javaVersion = getJavaVersionNumber()
if (!DEFAULTS_JSON['exclude-openjceplus'].contains(javaVersion)) {
openjceplusBuildArgs += '--bundle-openjceplus'
def openjceplusBranch = "semeru-java" + javaVersion.toString()
if (buildConfig.RELEASE) {
try {
def branchSuffix = (buildConfig.PUBLISH_NAME =~ /jdk-([0-9]+(\.[0-9]+){0,3})\+.*/)[ 0 ][ 1 ]
openjceplusBranch = "semeru-java-" + branchSuffix
} catch (IndexOutOfBoundsException e) {
context.println "WARNING: OpenJCEPlus Branch cannot be determined based on PUBLISH_NAME. Using default branch: ${openjceplusBranch}"
}
}
context.println "OpenJCEPlus Branch: $openjceplusBranch"
openjceplusBuildArgs += "--bundle-openjceplus --openjceplus-branch ${openjceplusBranch}"
}

context.withEnv(['BUILD_ARGS=' + openjceplusBuildArgs]) {
Expand Down
1 change: 1 addition & 0 deletions pipelines/build/common/trigger_beta_build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ if (triggerMainBuild || triggerEvaluationBuild) {
string(name: 'releaseType', value: "Weekly"),
string(name: 'scmReference', value: "$latestAdoptTag"),
string(name: 'overridePublishName', value: "$publishJobTag"),
string(name: 'overrideOpenJCEPlusBranch', value: "$openjceplusBranch"),
booleanParam(name: 'aqaAutoGen', value: true),
booleanParam(name: 'enableTests', value: enableTesting),
string(name: 'additionalConfigureArgs', value: "$additionalConfigureArgs")
Expand Down
1 change: 1 addition & 0 deletions pipelines/build/openjdk_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ if (scmVars != null || configureBuild != null || buildConfigurations != null) {
aqaReference,
aqaAutoGen,
overridePublishName,
overrideOpenJCEPlusBranch,
useAdoptBashScripts,
additionalConfigureArgs,
scmVars,
Expand Down
1 change: 1 addition & 0 deletions pipelines/jobs/pipeline_job_template.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ pipelineJob("${BUILD_FOLDER}/${JOB_NAME}") {
stringParam('buildConfigFilePath', '', "Relative path to where the jdkxx_pipeline_config.groovy file is located. It contains the build configurations for each platform, architecture and variant.<br>Default: <code>${defaultsJson['configDirectories']['build']}/jdkxx_pipeline_config.groovy</code>")
choiceParam('releaseType', [jobReleaseType, 'Nightly', 'Nightly Without Publish', 'Weekly', 'Weekly Without Publish', 'Release'].unique(), 'Nightly - release a standard nightly build.<br/>Nightly Without Publish - run a nightly but do not publish.<br/>Weekly - release a standard weekly build, run with extended tests.<br/>Weekly Without Publish - run a weekly but do not publish.<br/>Release - this is a release, this will need to be manually promoted.')
stringParam('overridePublishName', '', '<strong>REQUIRED for OpenJ9</strong>: Name that determines the publish name (and is used by the meta-data file), defaults to scmReference(minus _adopt if present).<br/>Nightly builds: Leave blank (defaults to a date_time stamp).<br/>OpenJ9 Release build Java 8 example <code>jdk8u192-b12_openj9-0.12.1</code> and for OpenJ9 Java 11 example <code>jdk-11.0.2+9_openj9-0.12.1</code>.')
stringParam('overrideOpenJCEPlusBranch', '', '<strong>Optional for OpenJ9</strong>: Ovveride the naming convention of the OpenJCEPlus Branch to checkout, defaults to semeru-java<major version> for non-releases and semeru-java-<openjdk version> for releases.<br/>Nightly builds: Leave blank (defaults to a date_time stamp).<br/>OpenJ9 Release build Java 8 example <code>jdk8u192-b12_openj9-0.12.1</code> and for OpenJ9 Java 11 example <code>jdk-11.0.2+9_openj9-0.12.1</code>.')
stringParam('scmReference', '', 'Tag name or Branch name from which openjdk source code repo to build. Nightly builds: Defaults to, Hotspot=dev, OpenJ9=openj9, others=master.</br>Release builds: For hotspot JDK8 this would be the OpenJDK tag, for hotspot JDK11+ this would be the Adopt merge tag for the desired OpenJDK tag eg.jdk-11.0.4+10_adopt, and for OpenJ9 this will be the release branch, eg.openj9-0.14.0.')
stringParam('buildReference', '', 'SHA1 or Tag name or Branch name of temurin-build repo. Defaults to master')
stringParam('ciReference', '', 'SHA1 or Tag name or Branch name of ci-jenkins-pipeline repo. Defaults to master')
Expand Down
1 change: 1 addition & 0 deletions pipelines/jobs/release_pipeline_job_template.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ pipelineJob("${BUILD_FOLDER}/${JOB_NAME}") {
stringParam('helperReference', releaseTag, 'Tag name or Branch name of jenkins-helper repo. Defaults to master')
stringParam('aqaReference', aqaTag, 'Tag name or Branch name of aqa-tests. Defaults to master')
stringParam('overridePublishName', '', 'Specify a different scmReference tag when doing the actual Publish, eg.for OpenJ9')
stringParam('overrideOpenJCEPlusBranch', '', 'Specify a different OpenJCEPlus Branch name')
stringParam('additionalConfigureArgs', '', "Additional arguments that will be ultimately passed to OpenJDK's <code>./configure</code>. jdk8 might have a different one!")

// default value not matter for release
Expand Down
3 changes: 3 additions & 0 deletions pipelines/library/src/common/IndividualBuildConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class IndividualBuildConfig implements Serializable {
final String JDK_BOOT_VERSION
final boolean RELEASE
final String PUBLISH_NAME
final String OPENJCEPLUS_BRANCH
final String ADOPT_BUILD_NUMBER
final boolean ENABLE_TESTS
final boolean ENABLE_TESTDYNAMICPARALLEL
Expand Down Expand Up @@ -98,6 +99,7 @@ class IndividualBuildConfig implements Serializable {
JDK_BOOT_VERSION = map.get("JDK_BOOT_VERSION") != null ? map.get("JDK_BOOT_VERSION").trim() : null
RELEASE = map.get("RELEASE")
PUBLISH_NAME = map.get("PUBLISH_NAME") != null ? map.get("PUBLISH_NAME").trim() : null
OPENJCEPLUS_BRANCH = map.get("OPENJCEPLUS_BRANCH") != null ? map.get("OPENJCEPLUS_BRANCH").trim() : null
ADOPT_BUILD_NUMBER = map.get("ADOPT_BUILD_NUMBER") != null ? map.get("ADOPT_BUILD_NUMBER").trim() : null
ENABLE_TESTS = map.get("ENABLE_TESTS")
ENABLE_TESTDYNAMICPARALLEL = map.get("ENABLE_TESTDYNAMICPARALLEL")
Expand Down Expand Up @@ -154,6 +156,7 @@ class IndividualBuildConfig implements Serializable {
JDK_BOOT_VERSION : JDK_BOOT_VERSION,
RELEASE : RELEASE,
PUBLISH_NAME : PUBLISH_NAME,
OPENJCEPLUS_BRANCH : OPENJCEPLUS_BRANCH,
ADOPT_BUILD_NUMBER : ADOPT_BUILD_NUMBER,
ENABLE_TESTS : ENABLE_TESTS,
ENABLE_TESTDYNAMICPARALLEL: ENABLE_TESTDYNAMICPARALLEL,
Expand Down
1 change: 1 addition & 0 deletions pipelines/src/test/groovy/IndividualBuildConfigTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class IndividualBuildConfigTest {
RELEASE : false,
WEEKLY : false,
PUBLISH_NAME : 'm',
OPENJCEPLUS_BRANCH : 'aa',
ADOPT_BUILD_NUMBER : 'n',
ENABLE_TESTS : true,
ENABLE_INSTALLERS : true,
Expand Down

0 comments on commit 8b959f6

Please sign in to comment.