diff --git a/JenkinsJobs/Builds/build.jenkinsfile b/JenkinsJobs/Builds/build.jenkinsfile index 0b492a59b26..ff68a500a10 100644 --- a/JenkinsJobs/Builds/build.jenkinsfile +++ b/JenkinsJobs/Builds/build.jenkinsfile @@ -1,5 +1,7 @@ @groovy.transform.Field def BUILD = null +@groovy.transform.Field +def BUILD_PROPERTIES = [:] pipeline { options { @@ -59,29 +61,22 @@ pipeline { def job = utilities.matchPattern('Job name', "${JOB_BASE_NAME}", [ /(?[IY])-build-(?\d).(?\d+)/ ]) // Load build properties and configuration from the properties and configuration file - assignEnvVariable('BUILD_TYPE', job.type) - def configurations = readJSON(file: "${WORKSPACE}/JenkinsJobs/buildConfigurations.json") - BUILD = configurations["${BUILD_TYPE}"] - assignEnvVariable('BUILD_TYPE_NAME', BUILD.typeName) + BUILD = readJSON(file: 'JenkinsJobs/buildConfigurations.json')[job.type] + + def int jobStart = currentBuild.startTimeInMillis.intdiv(1000) + BUILD_PROPERTIES.TIMESTAMP = sh(script: "TZ='America/New_York' date +%Y%m%d-%H%M --date='@${jobStart}'", returnStdout: true) + BUILD_PROPERTIES.BUILD_TYPE = job.type + BUILD_PROPERTIES.BUILD_TYPE_NAME = BUILD.typeName + BUILD_PROPERTIES.BUILD_ID = "${BUILD_PROPERTIES.BUILD_TYPE}${BUILD_PROPERTIES.TIMESTAMP}" + BUILD_PROPERTIES += readProperties(file: "${CJE_ROOT}/buildproperties.txt", interpolate: true) + BUILD_PROPERTIES.TEST_CONFIGURATIONS_EXPECTED = BUILD.tests.collect{ c -> + "${testJobName(c)}_${c.os}.${c.ws}.${c.arch}_${c.javaVersion}" + }.join(',') + + // Export build properties + BUILD_PROPERTIES.each{ key, value -> assignEnvVariable(key, value) } assignEnvVariable('GIT_SUBMODULE_BRANCHES', BUILD.branches ? BUILD.branches.collect{ name, branch -> "${name}:${branch}" }.join(',') : '') - assignEnvVariable('TEST_NAME_PREFIX', "ep${job.major}${job.minor}${BUILD_TYPE}-unit") - assignEnvVariable('TEST_CONFIGURATIONS_EXPECTED', BUILD.tests.collect{ c -> - "${TEST_NAME_PREFIX}-${c.os}-${c.arch}-java${c.javaVersion}_${c.os}.${c.ws}.${c.arch}_${c.javaVersion}" - }.join(',')) - } - dir("${CJE_ROOT}") { - sh '''#!/bin/bash -xe - chmod +x mbscripts/* - chmod +x $CJE_ROOT/scripts/notarizeMacApp.sh - - ./mbscripts/mb010_createEnvfiles.sh ${CJE_ROOT}/buildproperties.shsource 2>&1 - ''' } - exportPropertiesAsEnvironmentVariables("${CJE_ROOT}/buildproperties.properties", [ - 'BUILD_ID', - 'STREAM', 'RELEASE_VER', - 'PREVIOUS_RELEASE_ID', 'PREVIOUS_RELEASE_VER', - ]) } } stage('Clone and tag Build Inputs') { @@ -119,7 +114,6 @@ pipeline { // Try to find the last tag of the current build type that is available as a promoted build // by checking the most recent 5 tags and seeing if an update site for it exists sh '''#!/bin/bash -xe - source $CJE_ROOT/buildproperties.shsource updateSiteRootPath=${EP_ECLIPSE_UPDATES}/${STREAMMajor}.${STREAMMinor}-${BUILD_TYPE}-builds lastTagList=$(git tag --list "${BUILD_TYPE}*" | tail -n5 | tac) for lt in ${lastTagList}; do @@ -149,8 +143,6 @@ pipeline { // Create git tags and push changes sshagent (['github-bot-ssh']) { sh '''#!/bin/bash -xe - source $CJE_ROOT/buildproperties.shsource - function remoteURL { git config remote.origin.url | sed --expression 's,https://github.com/,git@github.com:,' } @@ -183,7 +175,6 @@ pipeline { steps { dir("${AGG_DIR}") { sh '''#!/bin/bash -xe - source $CJE_ROOT/buildproperties.shsource mkdir -p ${TEMP_DIR} mvn clean install -pl :eclipse-sdk-prereqs,:org.eclipse.jdt.core.compiler.batch \ @@ -204,6 +195,13 @@ pipeline { 2>&1 | tee ${logDir}/mb220_buildSdkPatch.sh.log # Capture the build log for the subsequent scan for comparator errors ''' + script { + def mavenProperties = readProperties(file: 'eclipse-platform-parent/target/mavenproperties.properties') + mavenProperties.each{ key, value -> assignEnvVariable(key, value) } + BUILD_PROPERTIES += mavenProperties + // Store now complete build-properties + writeFile(file: "${CJE_ROOT}/buildproperties.properties", text: BUILD_PROPERTIES.collect{ key, value -> "${key}=${value}"}.join('\n')) + } } } } @@ -213,13 +211,8 @@ pipeline { } steps { sh '''#!/bin/bash -xe - source $CJE_ROOT/scripts/common-functions.shsource - source $CJE_ROOT/buildproperties.shsource - # Gather maven properties mkdir -p ${DROP_DIR}/$BUILD_ID - cp ${AGG_DIR}/eclipse-platform-parent/target/mavenproperties.properties ${DROP_DIR}/$BUILD_ID/mavenproperties.properties - comparatorRepo=$(grep '^comparator.repo=' ${DROP_DIR}/${BUILD_ID}/mavenproperties.properties | cut -d'=' -f2-) # Gather artifactcomparisons pushd ${AGG_DIR} @@ -232,9 +225,10 @@ pipeline { #TODO: Generally try to avoid the need to capture the build log in a file/for teeing cp ${logDir}/mb220_buildSdkPatch.sh.log ${DROP_DIR}/$BUILD_ID/buildlogs/ + #TODO: when outputting comparator error logs, add the baseline repository in the metadata (even on non-failure?) so that it doesn't have to be set here explicitly java \ -DbuildDirectory=${DROP_DIR}/$BUILD_ID \ - -DcomparatorRepo=${comparatorRepo} \ + -DcomparatorRepo=${COMPARATOR_BASELINE} \ ${WORKSPACE}/scripts/releng/ComparatorSummaryExtractor.java comparatorLogMinimumSize=350 @@ -242,13 +236,15 @@ pipeline { logSize=$(stat --format='%s' ${comparatorLog}) if [[ ${logSize} -gt ${comparatorLogMinimumSize} ]]; then echo -e "DEBUG: found logsize greater an minimum. preparing message using ${link}" - fn-write-property COMPARATOR_ERRORS_SUBJECT "\\"- Comparator Errors Found\\"" + echo "- Comparator Errors Found" > comparatorErrorsSubject else echo -e "DEBUG: comparator logSize of $logSize was not greater than comparatorLogMinimumSize of ${comparatorLogMinimumSize}" - fn-write-property COMPARATOR_ERRORS_SUBJECT "\\"\\"" + touch comparatorErrorsSubject fi ''' - exportPropertiesAsEnvironmentVariables("${CJE_ROOT}/buildproperties.properties", [ 'COMPARATOR_ERRORS_SUBJECT' ]) + script { // Export subject to signal comparator errors, if any + assignEnvVariable('COMPARATOR_ERRORS_SUBJECT', readFile("${WORKSPACE}/comparatorErrorsSubject").trim()) + } } } stage('Promote results') { @@ -267,7 +263,6 @@ pipeline { } sh '''#!/bin/bash -xe cp $CJE_ROOT/buildproperties.* ${DROP_DIR}/${BUILD_ID} - source $CJE_ROOT/buildproperties.shsource mkdir -p ${DROP_DIR}/${BUILD_ID}/testresults/consolelogs @@ -303,6 +298,7 @@ pipeline { notarizeLogDir=$CJE_ROOT/notarizeLog mkdir -p $notarizeLogDir + chmod +x ${CJE_ROOT}/scripts/notarizeMacApp.sh pushd ${DROP_DIR}/${BUILD_ID} for macProduct in *.dmg; do (/bin/bash ${CJE_ROOT}/scripts/notarizeMacApp.sh ${macProduct} > $notarizeLogDir/${macProduct}.log 2>&1)& @@ -419,7 +415,6 @@ pipeline { } sh '''#!/bin/bash -xe cp $CJE_ROOT/buildproperties.* ${EQUINOX_DROP_DIR}/${BUILD_ID} - source $CJE_ROOT/buildproperties.shsource # Gather Equinox Starter Kit for file in ${PRODUCTS_DIR}/equinox-starterkit/target/products/*; do @@ -430,6 +425,7 @@ pipeline { notarizeLogDir=$CJE_ROOT/notarizeEqLog mkdir -p $notarizeLogDir + chmod +x ${CJE_ROOT}/scripts/notarizeMacApp.sh pushd ${EQUINOX_DROP_DIR}/${BUILD_ID} (/bin/bash ${CJE_ROOT}/scripts/notarizeMacApp.sh EclipseRT-OSGi-StarterKit-$BUILD_ID-macosx-cocoa-x86_64.dmg > $notarizeLogDir/equinoxX64.log 2>&1)& popd @@ -497,7 +493,6 @@ pipeline { steps { sshagent(['projects-storage.eclipse.org-bot-ssh']) { sh '''#!/bin/bash -xe - source $CJE_ROOT/buildproperties.shsource repoPath=${EP_ECLIPSE_UPDATES}/${STREAMMajor}.${STREAMMinor}-${BUILD_TYPE}-builds/${BUILD_ID} ssh genie.releng@projects-storage.eclipse.org mkdir -p ${repoPath} scp -r ${PLATFORM_REPO_DIR}/. genie.releng@projects-storage.eclipse.org:${repoPath}/. @@ -555,7 +550,7 @@ pipeline { steps { script { for (c in BUILD.tests) { - build job: "${BUILD.testsFolder}/${TEST_NAME_PREFIX}-${c.os}-${c.arch}-java${c.javaVersion}", wait: false, parameters: [ + build job: "${BUILD.testsFolder}/${testJobName(c)}", wait: false, parameters: [ string(name: 'buildId', value: "${BUILD_ID}"), string(name: 'testAgent', value: "${c.agent}"), ] @@ -625,10 +620,7 @@ def assignEnvVariable(String name, String value) { utilities.assignEnvVariable(name, value) } -def exportPropertiesAsEnvironmentVariables(String propertiesFile, Collection exportedVariables){ - def properties = readProperties(file: propertiesFile, charset: 'UTF-8') - for (envVar in exportedVariables) { - def value = properties[envVar].trim() - assignEnvVariable(envVar, value.startsWith('"') && value.endsWith('"') ? value.substring(1, value.length() - 1) : value) - } +@NonCPS +def testJobName(Map c) { + return "ep${BUILD_PROPERTIES.STREAMMajor}${BUILD_PROPERTIES.STREAMMinor}${BUILD_PROPERTIES.BUILD_TYPE}-unit-${c.os}-${c.arch}-java${c.javaVersion}" } diff --git a/JenkinsJobs/Builds/markBuild.jenkinsfile b/JenkinsJobs/Builds/markBuild.jenkinsfile index 5618968f41d..544c2ed3d17 100644 --- a/JenkinsJobs/Builds/markBuild.jenkinsfile +++ b/JenkinsJobs/Builds/markBuild.jenkinsfile @@ -77,5 +77,5 @@ pipeline { def readBuildProperty(String name) { def buildPropertiesURL = "https://download.eclipse.org/eclipse/downloads/drops4/${buildId}/buildproperties.properties" def buildProperties = readProperties(text: sh(script: "curl --fail ${buildPropertiesURL}", returnStdout: true)) - return buildProperties[name].replace('"','') // Remove surrounding quotes + return buildProperties[name] } diff --git a/JenkinsJobs/Cleanup/cleanupBuilds.jenkinsfile b/JenkinsJobs/Cleanup/cleanupBuilds.jenkinsfile index 9c317e5eae4..7a1705fc780 100644 --- a/JenkinsJobs/Cleanup/cleanupBuilds.jenkinsfile +++ b/JenkinsJobs/Cleanup/cleanupBuilds.jenkinsfile @@ -43,9 +43,9 @@ pipeline { utilities = load "JenkinsJobs/shared/utilities.groovy" utilities.setDryRun(false) def buildProperties = readProperties(file: 'cje-production/buildproperties.txt') - devVersionMajor = buildProperties.STREAMMajor.replace('"','').toInteger() // Remove surrounding quotes - devVersionMinor = buildProperties.STREAMMinor.replace('"','').toInteger() // Remove surrounding quotes - devVersionService = buildProperties.STREAMService.replace('"','').toInteger() // Remove surrounding quotes + devVersionMajor = buildProperties.STREAMMajor.toInteger() + devVersionMinor = buildProperties.STREAMMinor.toInteger() + devVersionService = buildProperties.STREAMService.toInteger() } } } diff --git a/JenkinsJobs/Releng/prepareNextDevCycle.jenkinsfile b/JenkinsJobs/Releng/prepareNextDevCycle.jenkinsfile index 5954473257f..c448a6e828c 100644 --- a/JenkinsJobs/Releng/prepareNextDevCycle.jenkinsfile +++ b/JenkinsJobs/Releng/prepareNextDevCycle.jenkinsfile @@ -47,13 +47,12 @@ pipeline { assignEnvVariable('NEXT_RELEASE_VERSION_MINOR', nextVersion.minor) echo "PREVIOUS_RELEASE_CANDIDATE_ID: ${PREVIOUS_RELEASE_CANDIDATE_ID}" - def buildPropertiesTxt = sh(script: "curl --fail https://download.eclipse.org/eclipse/downloads/drops4/${PREVIOUS_RELEASE_CANDIDATE_ID}/buildproperties.txt", returnStdout: true) - def buildProperties = readProperties(text: buildPropertiesTxt) - assignEnvVariable('IS_JAVA_RELEASE_IMMINENT', !buildProperties.NEXT_JAVA_RELEASE_DATE.replace('"','').isEmpty()) // Remove surrounding quotes + def buildProperties = utilities.loadBuildDropProperties("${PREVIOUS_RELEASE_CANDIDATE_ID}") + assignEnvVariable('IS_JAVA_RELEASE_IMMINENT', !buildProperties.NEXT_JAVA_RELEASE_DATE.trim().isEmpty()) // Remove surrounding quotes def previousRC = utilities.matchBuildIdentifier("${PREVIOUS_RELEASE_CANDIDATE_ID}", { iBuild -> - iBuild.major = buildProperties.STREAMMajor.replace('"','') // Remove surrounding quotes - iBuild.minor = buildProperties.STREAMMinor.replace('"','') // Remove surrounding quotes + iBuild.major = buildProperties.STREAMMajor + iBuild.minor = buildProperties.STREAMMinor assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_TAG', "${PREVIOUS_RELEASE_CANDIDATE_ID}") assignEnvVariable('PREVIOUS_RELEASE_CANDIDATE_GIT_TAG', "${PREVIOUS_RELEASE_CANDIDATE_ID}") }, { sBuild -> @@ -153,11 +152,9 @@ pipeline { stage('Update build scripts') { steps { replaceAllInFile('cje-production/buildproperties.txt', [ - "RELEASE_VER=\".*\"" : "RELEASE_VER=\"${NEXT_RELEASE_VERSION}\"", - "STREAM=\".*\"" : "STREAM=\"${NEXT_RELEASE_VERSION}.0\"", - "STREAMMajor=\".*\"" : "STREAMMajor=\"${NEXT_RELEASE_VERSION_MAJOR}\"", - "STREAMMinor=\".*\"" : "STREAMMinor=\"${NEXT_RELEASE_VERSION_MINOR}\"", - "NEXT_JAVA_RELEASE_DATE=\".*\"" : "NEXT_JAVA_RELEASE_DATE=\"${NEXT_JAVA_RELEASE_DATE}\"", + 'STREAMMajor=.*' : "STREAMMajor=${NEXT_RELEASE_VERSION_MAJOR}", + 'STREAMMinor=.*' : "STREAMMinor=${NEXT_RELEASE_VERSION_MINOR}", + 'NEXT_JAVA_RELEASE_DATE=.*' : "NEXT_JAVA_RELEASE_DATE=${NEXT_JAVA_RELEASE_DATE}", ]) replaceInFile('products/eclipse-platform/platform.p2.inf', [ "${PREVIOUS_RELEASE_VERSION} Release" : "${NEXT_RELEASE_VERSION} Release", @@ -196,10 +193,10 @@ pipeline { "-DnewPrevious-release.baseline=https://download.eclipse.org/eclipse/updates/${PREVIOUS_RELEASE_VERSION}-I-builds/${PREVIOUS_RELEASE_CANDIDATE_I_BUILD}/" ''' replaceAllInFile('cje-production/buildproperties.txt', [ - 'PREVIOUS_RELEASE_VER=".*"' : "PREVIOUS_RELEASE_VER=\"${PREVIOUS_RELEASE_CANDIDATE_TAG}\"", - 'PREVIOUS_RELEASE_REPO_ID=".*"' : "PREVIOUS_RELEASE_REPO_ID=\"${PREVIOUS_RELEASE_VERSION}-I-builds\"", - 'BASEBUILD_ID=".*"' : "BASEBUILD_ID=\"${PREVIOUS_RELEASE_CANDIDATE_I_BUILD}\"", - 'PREVIOUS_RELEASE_ID=".*"' : "PREVIOUS_RELEASE_ID=\"${PREVIOUS_RELEASE_CANDIDATE_ID}\"", + 'PREVIOUS_RELEASE_VER=.*' : "PREVIOUS_RELEASE_VER=${PREVIOUS_RELEASE_CANDIDATE_TAG}", + 'PREVIOUS_RELEASE_REPO_ID=.*' : "PREVIOUS_RELEASE_REPO_ID=${PREVIOUS_RELEASE_VERSION}-I-builds", + 'BASEBUILD_ID=.*' : "BASEBUILD_ID=${PREVIOUS_RELEASE_CANDIDATE_I_BUILD}", + 'PREVIOUS_RELEASE_ID=.*' : "PREVIOUS_RELEASE_ID=${PREVIOUS_RELEASE_CANDIDATE_ID}", ]) gitCommitAllExcludingSubmodules("Move previous version to ${PREVIOUS_RELEASE_CANDIDATE_TAG} in build scripts") @@ -430,7 +427,7 @@ def githubAPI = null @NonCPS def assignEnvVariable(String name, Object value) { - utilities.assignEnvVariable(name, value) + utilities.assignEnvVariable(name, value?.toString()) } @NonCPS diff --git a/JenkinsJobs/Releng/promoteBuild.jenkinsfile b/JenkinsJobs/Releng/promoteBuild.jenkinsfile index 8e99732c83e..cc5d5101fa2 100644 --- a/JenkinsJobs/Releng/promoteBuild.jenkinsfile +++ b/JenkinsJobs/Releng/promoteBuild.jenkinsfile @@ -76,11 +76,10 @@ pipeline { }) assignEnvVariable('REPO_ID', "I${build.date}-${build.time}") - def buildPropertiesTxt = sh(script: "curl --fail https://download.eclipse.org/eclipse/downloads/drops4/${DROP_ID}/buildproperties.txt", returnStdout: true) - def buildProperties = readProperties(text: buildPropertiesTxt) - assignEnvVariable('BUILD_MAJOR', buildProperties.STREAMMajor.replace('"','')) // Remove surrounding quotes - assignEnvVariable('BUILD_MINOR', buildProperties.STREAMMinor.replace('"','')) // Remove surrounding quotes - assignEnvVariable('BUILD_SERVICE', buildProperties.STREAMService.replace('"','')) // Remove surrounding quotes + def buildProperties = utilities.loadBuildDropProperties("${DROP_ID}") + assignEnvVariable('BUILD_MAJOR', buildProperties.STREAMMajor) + assignEnvVariable('BUILD_MINOR', buildProperties.STREAMMinor) + assignEnvVariable('BUILD_SERVICE', buildProperties.STREAMService) if ("${CHECKPOINT}" ==~ /M\d+([a-z])?/ || "${CHECKPOINT}" ==~ /RC\d+([a-z])?/) { // milestone or RC promotion assignEnvVariable('DL_TYPE', 'S') @@ -231,10 +230,10 @@ pipeline { -DnewPrevious-release.baseline="${RELEASE_P2_REPOSITORY}" ''' utilities.replaceAllInFile('cje-production/buildproperties.txt', [ - 'PREVIOUS_RELEASE_VER=".*?"' : "PREVIOUS_RELEASE_VER=\"${BUILD_MAJOR}.${BUILD_MINOR}\"", - 'PREVIOUS_RELEASE_REPO_ID=".*?"' : "PREVIOUS_RELEASE_REPO_ID=\"${BUILD_MAJOR}.${BUILD_MINOR}\"", - 'BASEBUILD_ID=".*?"' : "BASEBUILD_ID=\"${DL_DROP_ID}\"", - 'PREVIOUS_RELEASE_ID=".*?"' : "PREVIOUS_RELEASE_ID=\"${DL_DROP_ID}\"", + 'PREVIOUS_RELEASE_VER=.*' : "PREVIOUS_RELEASE_VER=${BUILD_MAJOR}.${BUILD_MINOR}", + 'PREVIOUS_RELEASE_REPO_ID=.*' : "PREVIOUS_RELEASE_REPO_ID=${BUILD_MAJOR}.${BUILD_MINOR}", + 'BASEBUILD_ID=.*' : "BASEBUILD_ID=${DL_DROP_ID}", + 'PREVIOUS_RELEASE_ID=.*' : "PREVIOUS_RELEASE_ID=${DL_DROP_ID}", ]) utilities.modifyJSON('JenkinsJobs/buildConfigurations.json') { builds -> // Remove old I/Y-build jobs for this release diff --git a/JenkinsJobs/Releng/publishPromotedBuild.jenkinsfile b/JenkinsJobs/Releng/publishPromotedBuild.jenkinsfile index 869aa8f1f20..7559522c9ec 100644 --- a/JenkinsJobs/Releng/publishPromotedBuild.jenkinsfile +++ b/JenkinsJobs/Releng/publishPromotedBuild.jenkinsfile @@ -57,14 +57,8 @@ pipeline { } else { error "RELEASE_TYPE, ${RELEASE_TYPE}, did not match any expected pattern." } - - def eclipseParentPOM = sh(script: "curl --fail https://raw.githubusercontent.com/eclipse-platform/eclipse.platform.releng.aggregator/refs/tags/${buildId}/eclipse-platform-parent/pom.xml", returnStdout: true) - def yearMatcher = eclipseParentPOM =~ /(?\d+)<\/releaseYear>/ - def monthMatcher = eclipseParentPOM =~ /(?\d+)<\/releaseMonth>/ - if (!yearMatcher.find() || !monthMatcher.find()) { - error "Eclipse Parent POM does not contain releaseYear or releaseMonth" - } - assignEnvVariable('TRAIN_NAME', yearMatcher.group('year') + '-' + monthMatcher.group('month')) + def buildProperties = utilities.loadBuildDropProperties(buildId) + assignEnvVariable('TRAIN_NAME', "${buildProperties.RELEASE_YEAR}-${buildProperties.RELEASE_MONTH}") if (!env.TRAIN_NAME) { error "TRAIN_NAME is empty." } diff --git a/JenkinsJobs/seedJob.jenkinsfile b/JenkinsJobs/seedJob.jenkinsfile index 17392ea3399..ec328991e6c 100644 --- a/JenkinsJobs/seedJob.jenkinsfile +++ b/JenkinsJobs/seedJob.jenkinsfile @@ -40,9 +40,9 @@ pipeline { def buildConfigurations = readJSON(file: 'buildConfigurations.json') buildConfigurations.each{ buildType, buildConfig -> - buildConfig.streams.each{ STREAM, streamConfig -> - def (MAJOR, MINOR) = STREAM.split('\\.') - pipelineJobDefinitions["${buildConfig.folder}/${buildType}-build-${STREAM}"] = [scriptPath: buildJob.scriptPath, branch: streamConfig.branch, + buildConfig.streams.each{ streamName, streamConfig -> + def (MAJOR, MINOR) = streamName.split('\\.') + pipelineJobDefinitions["${buildConfig.folder}/${buildType}-build-${streamName}"] = [scriptPath: buildJob.scriptPath, branch: streamConfig.branch, description: "Eclipse SDK ${buildConfig.typeName} builds", disabled: streamConfig.disabled, cronTrigger: '''\ TZ=America/Toronto # Format: Minute Hour Day Month Day-of-week (1-7) diff --git a/JenkinsJobs/shared/utilities.groovy b/JenkinsJobs/shared/utilities.groovy index 1b3200a8358..cd9618864c2 100644 --- a/JenkinsJobs/shared/utilities.groovy +++ b/JenkinsJobs/shared/utilities.groovy @@ -42,8 +42,9 @@ def stableBuildGitTag(CharSequence dropID) { } @NonCPS -def assignEnvVariable(String name, Object value) { - env[name] = value?.toString()?.trim() +def assignEnvVariable(String name, String value) { + value = value?.trim() + env[name] = value println("${name}=${value}") } @@ -208,14 +209,19 @@ private void gitPush(String refSpec, boolean force) { // --- remote file system operations --- +def Map loadBuildDropProperties(String buildId) { + def properties = sh(script: "curl --fail https://download.eclipse.org/eclipse/downloads/drops4/${buildId}/buildproperties.properties", returnStdout: true) + return readProperties(text: properties) +} + def List listBuildDropDirectoriesOnRemote(String remoteDirectory, String dropNamePattern = "*", int major = 0, int minor = 0, int service = 0) { def versionFilter = major == 0 ? '' :"""\ - | xargs grep -l 'STREAMMinor=\\"${minor}\\"' \ - | xargs grep -l 'STREAMMajor=\\"${major}\\"' \ - | xargs grep -l 'STREAMService=\\"${service}\\"' \ + | xargs grep -l 'STREAMMinor *= *\\"\\?${minor}\\"\\?\$' \ + | xargs grep -l 'STREAMMajor *= *\\"\\?${major}\\"\\?\$' \ + | xargs grep -l 'STREAMService *= *\\"\\?${service}\\"\\?\$' \ """.trim() def result = sh(script: """ssh genie.releng@projects-storage.eclipse.org "cd ${remoteDirectory} && \ - find -maxdepth 2 -type f -path './${dropNamePattern}/buildproperties.txt' \ + find -maxdepth 2 -type f -path './${dropNamePattern}/buildproperties.properties' \ ${versionFilter} | xargs dirname | sort -u" """, returnStdout: true).trim() return result.isEmpty() ? [] : result.split('\\s+').collect{ d -> d.startsWith('./') ? d.substring(2) : d } diff --git a/cje-production/buildproperties.txt b/cje-production/buildproperties.txt index 28fe1099ef7..ec5e155eca2 100644 --- a/cje-production/buildproperties.txt +++ b/cje-production/buildproperties.txt @@ -17,16 +17,15 @@ # with # are considered comments and no spaces allowed in keys # CJE build variables -RELEASE_VER="4.40" -STREAM="4.40.0" -STREAMMajor="4" -STREAMMinor="40" -STREAMService="0" -NEXT_JAVA_RELEASE_DATE="" +STREAMMajor=4 +STREAMMinor=40 +STREAMService=0 +RELEASE_VER=${STREAMMajor}.${STREAMMinor} +NEXT_JAVA_RELEASE_DATE= -PREVIOUS_RELEASE_VER="4.39" -PREVIOUS_RELEASE_REPO_ID="4.39" +PREVIOUS_RELEASE_VER=4.39 +PREVIOUS_RELEASE_REPO_ID=4.39 #build id for getting repo -BASEBUILD_ID="R-4.39-202602260420" +BASEBUILD_ID=R-4.39-202602260420 #release id for downloading eclipse -PREVIOUS_RELEASE_ID="R-4.39-202602260420" +PREVIOUS_RELEASE_ID=R-4.39-202602260420 diff --git a/cje-production/mbscripts/mb010_createEnvfiles.sh b/cje-production/mbscripts/mb010_createEnvfiles.sh deleted file mode 100755 index 9890436df6d..00000000000 --- a/cje-production/mbscripts/mb010_createEnvfiles.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash - -#******************************************************************************* -# Copyright (c) 2019, 2024 IBM Corporation and others. -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# Sravan Lakkimsetti - initial API and implementation -# Hannes Wellmann - Unify declaration of build-properties for I-, Y- and P-builds -#******************************************************************************* -set -e - -if [ $# -ne 1 ]; then - echo USAGE: $0 env_file - exit 1 -fi - -source $CJE_ROOT/scripts/common-functions.shsource - -shEnvFile=$(basename $1) -buildDir=$(dirname $1) -baseEnvFile=$(echo $shEnvFile |cut -d. -f1) -phpEnvFile=$(echo $baseEnvFile.php) -propEnvFile=$(echo $baseEnvFile.properties) - -BUILD_ENV_FILE=$CJE_ROOT/${shEnvFile} -BUILD_ENV_FILE_PHP=$CJE_ROOT/${phpEnvFile} -BUILD_ENV_FILE_PROP=$CJE_ROOT/${propEnvFile} - -fn-addToPropFiles () -{ - echo "export $1=$2" >> $BUILD_ENV_FILE - echo "\$$1 = $2;" >> $BUILD_ENV_FILE_PHP - echo "$1 = $2" >> $BUILD_ENV_FILE_PROP -} - -echo "#!/bin/bash" > $BUILD_ENV_FILE -echo " $BUILD_ENV_FILE_PHP - -# We set RAWDATE first thing here to make the "start of build" timestamp more accurate. -# Note that a roundup is added to compensate the occasional delay. -RAWDATE=$(TZ="America/New_York" date +%s) -REMAINDER=$((RAWDATE % 600)) -RAWDATE_TRUNC=$((RAWDATE - REMAINDER)) -export RAWDATE -fn-addToPropFiles TIMESTAMP "\"$(TZ="America/New_York" date +%Y%m%d-%H%M --date='@'$RAWDATE_TRUNC)\"" -fn-addToPropFiles BUILD_PRETTY_DATE "\"$(TZ="America/New_York" date --date='@'$RAWDATE_TRUNC)\"" - -while read propLine -do - if [[ ${propLine:0:1} == "#" ]]; then - continue - else - key=$(echo $propLine|cut -d= -f1) - value=$(echo $propLine|cut -d= -f2-) - if [[ -z $key ]]; then - continue - fi - fn-addToPropFiles $key "$value" - fi -done < ${CJE_ROOT}/buildproperties.txt - -source $BUILD_ENV_FILE -# add BUILD_ENV_FILE* variables to prop files before using fn-write-property in common-functions.shsource -fn-addToPropFiles BUILD_ENV_FILE "\"$BUILD_ENV_FILE\"" -fn-addToPropFiles BUILD_ENV_FILE_PHP "\"$BUILD_ENV_FILE_PHP\"" -fn-addToPropFiles BUILD_ENV_FILE_PROP "\"$BUILD_ENV_FILE_PROP\"" -# variables in buildproperties.txt are now defined, add other commonly used variables to prop files -fn-addToPropFiles BUILD_TYPE "\"${BUILD_TYPE}\"" -fn-addToPropFiles BUILD_TYPE_NAME "\"${BUILD_TYPE_NAME}\"" -fn-addToPropFiles BUILD_ID "\"$BUILD_TYPE$TIMESTAMP\"" -fn-addToPropFiles TEST_CONFIGURATIONS_EXPECTED "\"${TEST_CONFIGURATIONS_EXPECTED}\"" diff --git a/cje-production/readme.txt b/cje-production/readme.txt deleted file mode 100644 index 6f831646bdf..00000000000 --- a/cje-production/readme.txt +++ /dev/null @@ -1,8 +0,0 @@ -This is the location where we will develop production scripts for use on Cloudbees Jenkins Enterprise - -Here are some ground rules -1. Each script starts with mb_.sh. xxx is a 3 digit number - 000-099 - preparing build environment like setting environment variables etc. - -2. Every script should accept $ENV_FILE. this envrironment file is created at the preparing the build environment stage. -3. Every script should source "common-functions.shsource". This will contain common methods used across the scripts diff --git a/cje-production/scripts/common-functions.shsource b/cje-production/scripts/common-functions.shsource deleted file mode 100755 index b63affdf8ac..00000000000 --- a/cje-production/scripts/common-functions.shsource +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -#******************************************************************************* -# Copyright (c) 2019 IBM Corporation and others. -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# Sravan Kumar Lakkimsetti - initial API and implementation -#******************************************************************************* - -# USAGE: fn-write-property VAR_NAME -# VAR_NAME: Variable name to write as "variable=value" form -# This script assumes the following variables have been defined and are pointing -# to an appropriate file: -# BUILD_ENV_FILE=${buildDirectory}/buildproperties.shsource -# BUILD_ENV_FILE_PHP=${buildDirectory}/buildproperties.php -# BUILD_ENV_FILE_PROP=${buildDirectory}/buildproperties.properties - -# Note we always append to file, assuming if doesn't exist yet and will be -# created, and for each build, it won't exist, so will be written fresh for -# each build. - -fn-write-property () -{ - echo "export $1=$2" >> $BUILD_ENV_FILE - echo "\$$1 = $2;" >> $BUILD_ENV_FILE_PHP - echo "$1 = $2" >> $BUILD_ENV_FILE_PROP -} diff --git a/eclipse-platform-parent/saveproperties/mavenproperties.properties b/eclipse-platform-parent/saveproperties/mavenproperties.properties index 7ac3e287f96..1ea2ff95273 100644 --- a/eclipse-platform-parent/saveproperties/mavenproperties.properties +++ b/eclipse-platform-parent/saveproperties/mavenproperties.properties @@ -1,27 +1,5 @@ -# typical properties we may need elsewhere, such as -# to display in reports or PHP pages +# Common properties referenced throughout the builds and its produced artifacts -tycho.debug.artifactcomparator=${tycho.debug.artifactcomparator} -tycho.localArtifacts=${tycho.localArtifacts} -tycho.version=${tycho.version} -cbi-ecj-version=${cbi-ecj-version} -cbi-plugins.version=${cbi-plugins.version} - -java.class.path=${java.class.path} -java.class.version=${java.class.version} -java.home=${java.home} -java.io.tmpdir=${java.io.tmpdir} -java.library.path=${java.library.path} -java.runtime.name=${java.runtime.name} -java.runtime.version=${java.runtime.version} -java.specification.name=${java.specification.name} -java.version=${java.version} - -maven.home=${maven.home} -maven.repo.local=${maven.repo.local} - -comparator.repo=${comparator.repo} - -eclipse-p2-repo.url=${eclipse-p2-repo.url} - -sun.java.command=${sun.java.command} +RELEASE_YEAR=${releaseYear} +RELEASE_MONTH=${releaseMonth} +COMPARATOR_BASELINE=${comparator.repo} diff --git a/production/testScripts/runTests2.xml b/production/testScripts/runTests2.xml index c64f77b3577..006df0cdaa7 100644 --- a/production/testScripts/runTests2.xml +++ b/production/testScripts/runTests2.xml @@ -44,7 +44,6 @@ - @@ -465,17 +464,14 @@ - - - @@ -508,7 +504,7 @@ - + diff --git a/scripts/releng/BuildDropDataGenerator.java b/scripts/releng/BuildDropDataGenerator.java index dab4b7bc0bd..f013c2bd5ba 100644 --- a/scripts/releng/BuildDropDataGenerator.java +++ b/scripts/releng/BuildDropDataGenerator.java @@ -64,12 +64,15 @@ void mainEclipsePageData() throws IOException { JSON.Object buildProperties = JSON.Object.create(); // basic data + int major = Integer.parseInt(properties.get("STREAMMajor")); + int minor = Integer.parseInt(properties.get("STREAMMinor")); + int service = Integer.parseInt(properties.get("STREAMService")); buildProperties.add("identifier", JSON.String.create(buildId)); buildProperties.add("label", JSON.String.create(buildId)); buildProperties.add("kind", JSON.String.create(properties.get("BUILD_TYPE_NAME"))); - buildProperties.add("release", JSON.String.create(properties.get("STREAM"))); + buildProperties.add("release", JSON.String.create(major + "." + minor + "." + service)); buildProperties.add("releaseShort", JSON.String.create(properties.get("RELEASE_VER"))); - buildProperties.add("previousReleaseAPILabel", JSON.String.create(previousReleaseAPILabel(properties))); + buildProperties.add("previousReleaseAPILabel", JSON.String.create(previousReleaseAPILabel(major, minor))); buildProperties.add("timestamp", JSON.String.create(buildDate.toString())); // git log @@ -175,9 +178,7 @@ void buildLogsPageData() throws IOException { // --- data conversion/collection --- -String previousReleaseAPILabel(Map buildProps) { - int major = Integer.parseInt(buildProps.get("STREAMMajor")); - int minor = Integer.parseInt(buildProps.get("STREAMMinor")); +String previousReleaseAPILabel(int major, int minor) { if (minor == 0) { throw new IllegalStateException("New major version not yet handled"); } diff --git a/scripts/releng/utilities/OS.java b/scripts/releng/utilities/OS.java index 0653e5bd630..7f652fe7b18 100644 --- a/scripts/releng/utilities/OS.java +++ b/scripts/releng/utilities/OS.java @@ -42,13 +42,8 @@ public static Map loadProperties(Path file) throws IOException { try (var stream = Files.newInputStream(file)) { properties.load(stream); } - return properties.entrySet().stream().collect(Collectors.toUnmodifiableMap(e -> (String) e.getKey(), e -> { - String value = e.getValue().toString().trim(); - if (value.startsWith("\"") && value.endsWith("\"")) { - return value.substring(1, value.length() - 1); - } - return value; - })); + return properties.entrySet().stream() + .collect(Collectors.toUnmodifiableMap(e -> (String) e.getKey(), e -> e.getValue().toString().trim())); } public record FileInfo(long size, String hashSHA512) { diff --git a/sites/eclipse/build/buildlogs/logs.html b/sites/eclipse/build/buildlogs/logs.html index c521dc13c6a..5ad01e99c7c 100644 --- a/sites/eclipse/build/buildlogs/logs.html +++ b/sites/eclipse/build/buildlogs/logs.html @@ -19,8 +19,7 @@

Release Engineering Logs for ${label}

Build Properties

Build logs