Skip to content

Commit 3fa0715

Browse files
committed
Migrate website from PHP to plain HTML enhanced with JavaScript
The individual content of all pages is defined in and read from JSON files and replaced dynamically using JavaScript. The JSON files are generated during the build or upon completion of tests. Missing parts: - The page listing all test result logs is not implemented, instead of link to the file-system folder is used. - The promotion pipelines are not yet adapted to the new approach. Fixes #2656
1 parent 786ba47 commit 3fa0715

File tree

75 files changed

+2541
-5018
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2541
-5018
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
eclipse.preferences.version=1
2-
encoding//eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/staticDropFiles/testResults.php=UTF-8
32
encoding/<project>=UTF-8

JenkinsJobs/AutomatedTests/integrationTests.jenkinsfile

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ pipeline {
5555
extensions: [cloneOption(depth: 1, shallow: true, noTags: true), sparseCheckout([
5656
[path: 'JenkinsJobs/buildConfigurations.json'],
5757
[path: 'JenkinsJobs/shared/utilities.groovy'],
58+
[path: 'scripts/releng'],
59+
[path: 'eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles'],
60+
5861
])])
5962
script {
6063
def buildConfigurations = readJSON(file: 'JenkinsJobs/buildConfigurations.json')
@@ -104,20 +107,34 @@ pipeline {
104107
localResultsDirectory="workarea/${buildId}/eclipse-testing/results"
105108
ssh [email protected] mkdir -p ${remoteResultsDirectory}
106109
if [ -d "${localResultsDirectory}/xml" ] && [ -z "$(find ${localResultsDirectory}/xml -maxdepth 0 -empty)" ]; then
110+
111+
# As long as not all tests run with Java-25 (or later) we cannot use multi-file Source Programs and have to compile manually
112+
pushd scripts/releng
113+
javac TestResultsGenerator.java
114+
javac utilities/JSON.java
115+
javac utilities/OS.java
116+
javac utilities/XmlProcessorFactoryRelEng.java
117+
# Generate new summary file
118+
java \
119+
-DxmlDirectory="${WORKSPACE}/${localResultsDirectory}/xml" \
120+
-DtestsConfigExpected=${JOB_BASE_NAME} \
121+
-DtestManifestFile="${WORKSPACE}/eclipse.platform.releng.tychoeclipsebuilder/eclipse/publishingFiles/testManifest.xml" \
122+
TestResultsGenerator
123+
popd
124+
107125
# First delete result files from a previous run of the same configuration (in case that test configuration was run again), then transfer the new results.
108126
ssh [email protected] rm -rfv ${remoteResultsDirectory}/${JOB_BASE_NAME}* ${remoteResultsDirectory}/*/*${JOB_BASE_NAME}*
109127
scp -r ${localResultsDirectory}/* [email protected]:${remoteResultsDirectory}
128+
110129
# Download the result summary directly to the storage server
111130
112-
curl --fail --location --output "${remoteResultsDirectory}/${JOB_BASE_NAME}.xml" "${BUILD_URL}/testReport/api/xml?tree=failCount,passCount,skipCount,duration"
131+
curl --fail --location --output "${remoteResultsDirectory}/${JOB_BASE_NAME}.xml" "${BUILD_URL}/testReport/api/json?tree=failCount,passCount,skipCount,duration"
113132
fi
114133
'''
115134
}
116135
}
117136
if (currentBuild.result == 'SUCCESS' || currentBuild.result == 'UNSTABLE') {
118-
build job: 'Releng/updateTestResultIndex', wait: false, parameters: [
119-
string(name: 'buildID', value: "${params.buildId}")
120-
]
137+
build job: 'Releng/updateIndex', wait: false
121138
}
122139
}
123140
}

JenkinsJobs/Builds/build.jenkinsfile

Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pipeline {
3434
environment {
3535
MAVEN_OPTS = '-Xmx4G'
3636
CJE_ROOT = "${WORKSPACE}/cje-production"
37+
SCRIPTS = "${WORKSPACE}/scripts"
3738
AGG_DIR = "${CJE_ROOT}/gitCache/eclipse.platform.releng.aggregator"
3839
logDir = "$CJE_ROOT/buildlogs"
3940

@@ -168,31 +169,38 @@ pipeline {
168169
}
169170
// Git log creation
170171
sh '''#!/bin/bash -xe
171-
reportTimestamp=$(TZ="America/New_York" date +%Y%m%d-%H%M)
172+
reportTimestamp=$(TZ='UTC' date +%Y%m%d-%H%M)
172173
export lastTag=$(cat "${WORKSPACE}/lastTag")
173174
if [[ -n "$lastTag" ]]; then
174-
export gitLogFile="${DROP_DIR}/$BUILD_ID/gitLog.html"
175+
export gitLogFile="${DROP_DIR}/$BUILD_ID/gitLog.json"
175176
mkdir -p $(dirname "${gitLogFile}")
176177

177-
echo -e "<h2>Git log from $lastTag (previous) to $BUILD_ID (current)</h2>" > $gitLogFile
178-
echo -e "<h2>The tagging, and this report, were done at about $reportTimestamp</h2>" >> $gitLogFile
178+
echo '{' > $gitLogFile
179+
echo "\\"label\\": \\"${BUILD_ID}\\"," >> $gitLogFile
180+
echo "\\"logFrom\\": \\"${lastTag}\\"," >> $gitLogFile
181+
echo "\\"logTo\\": \\"${BUILD_ID}\\"," >> $gitLogFile
182+
echo "\\"timestamp\\": \\"${reportTimestamp}\\"," >> $gitLogFile
183+
echo "\\"repositories\\": [" >> $gitLogFile >> $gitLogFile
179184

180185
function createGitLog() {
181186
gitURL=$(git config remote.origin.url | sed --expression 's,[email protected]:,https://github.com/,' | sed 's/\\.git$//')
182187
gitName="${gitURL##*/}"
183-
gitLog=$(git log $lastTag..$BUILD_ID --date=short --format=format:"<tr><td class=\"datecell\">%cd</td><td class=\"commitcell\"><a href=\"${gitURL}/commit/%H\">%s</a></td><td class=\"authorcell\">%aN</td></tr>")
188+
#TODO: handle potential double-quotes in commit message?
189+
gitLog=$(git log $lastTag..$BUILD_ID --date=short --format=format:"{ \\"date\\": \\"%cd\\", \\"message\\": \\"%s\\", \\"author\\": \\"%aN\\", \\"url\\": \\"${gitURL}/commit/%H\\"},")
184190
if [ -n "$gitLog" ]; then
185191
echo "Record changes in ${gitName}"
186-
echo "<table><tbody> <tr><th class=\"cell\" colspan=\"3\">Repository: ${gitName}</th></tr>" >> $gitLogFile
187-
echo "<tr> <th class=\"datecell\">Date</th> <th class=\"commitcell\">Commit message</th> <th class=\"authorcell\">Author</th> </tr>" >> $gitLogFile
188-
echo "${gitLog}" >> $gitLogFile
189-
echo "</tbody></table><br><br>" >> $gitLogFile
190-
echo '' >> $gitLogFile
192+
echo "{" >> $gitLogFile
193+
echo "\\"name\\": \\"${gitName}\\"," >> $gitLogFile
194+
echo "\\"commits\\": [" >> $gitLogFile
195+
echo "${gitLog%,}" >> $gitLogFile
196+
echo "]}," >> $gitLogFile
191197
fi
192198
}
193199
export -f createGitLog
194200
createGitLog
195201
git submodule foreach 'createGitLog'
202+
203+
echo "{}]}" >> $gitLogFile # Append empty object to keep JSON valid
196204
else
197205
echo -e "\n\tGit log not generated because a reasonable previous tag could not be found." > $gitLogFile
198206
fi
@@ -291,14 +299,18 @@ pipeline {
291299
stage('Gather Eclipse parts') {
292300
tools {
293301
jdk 'temurin-jdk25-latest'
294-
}
302+
}
295303
environment {
296304
KEYRING = credentials('secret-subkeys-releng.asc')
297305
KEYRING_PASSPHRASE = credentials('secret-subkeys-releng.asc-passphrase')
298306
}
299307
steps {
308+
dir("${DROP_DIR}/${BUILD_ID}") {
309+
script {
310+
utilities.copyStaticWebsiteFiles("${AGG_DIR}", 'eclipse/build')
311+
}
312+
}
300313
sh '''#!/bin/bash -xe
301-
mkdir -p ${DROP_DIR}/${BUILD_ID}
302314
cp $CJE_ROOT/buildproperties.* ${DROP_DIR}/${BUILD_ID}
303315
source $CJE_ROOT/buildproperties.shsource
304316

@@ -441,20 +453,12 @@ pipeline {
441453
bash ${CJE_ROOT}/scripts/produceChecksum.sh eclipse
442454
popd
443455

444-
cp -r ${ECLIPSE_BUILDER_DIR}/eclipse/publishingFiles/staticDropFiles/. ${DROP_DIR}/${BUILD_ID}
445-
446456
java \
447-
-DisBuildTested=true \
448-
-DbuildType=${BUILD_TYPE} \
449-
-DdropTokenList='%repository%,%sdk%,%tests%,%runtime%,%jdtc%,%swt%' \
450-
-DdropHtmlFileName=index.php \
451-
-DxmlDirectoryName=${DROP_DIR}/${BUILD_ID}/testresults/xml \
452-
-DdropDirectoryName=${DROP_DIR}/${BUILD_ID} \
453-
-DdropTemplateFileName=${ECLIPSE_BUILDER_DIR}/eclipse/publishingFiles/templateFiles/index.template.php \
454-
-DcompileLogsDirectoryName=${DROP_DIR}/${BUILD_ID}/compilelogs/plugins \
455-
-DtestManifestFileName=${ECLIPSE_BUILDER_DIR}/eclipse/publishingFiles/testManifest.xml \
456-
-DtestsConfigExpected=${TEST_CONFIGURATIONS_EXPECTED} \
457-
${WORKSPACE}/scripts/releng/TestResultsGenerator.java
457+
-DdropDirectory=${DROP_DIR}/${BUILD_ID} \
458+
${SCRIPTS}/releng/BuildDropDataGenerator.java mainEclipse
459+
java \
460+
-DdropDirectory=${DROP_DIR}/${BUILD_ID} \
461+
${SCRIPTS}/releng/CompilerSummaryGenerator.java
458462
'''
459463
}
460464
}
@@ -479,14 +483,18 @@ pipeline {
479483
stage('Gather Equinox parts') {
480484
tools {
481485
jdk 'temurin-jdk25-latest'
482-
}
486+
}
483487
environment {
484488
KEYRING = credentials('secret-subkeys-releng.asc')
485489
KEYRING_PASSPHRASE = credentials('secret-subkeys-releng.asc-passphrase')
486490
}
487491
steps {
492+
dir("${EQUINOX_DROP_DIR}/${BUILD_ID}") {
493+
script {
494+
utilities.copyStaticWebsiteFiles("${AGG_DIR}", 'equinox/build')
495+
}
496+
}
488497
sh '''#!/bin/bash -xe
489-
mkdir -p ${EQUINOX_DROP_DIR}/${BUILD_ID}
490498
cp $CJE_ROOT/buildproperties.* ${EQUINOX_DROP_DIR}/${BUILD_ID}
491499
source $CJE_ROOT/buildproperties.shsource
492500

@@ -518,20 +526,18 @@ pipeline {
518526
cat $f
519527
done
520528

521-
# Publish Equinox
529+
# Build Equinox Launcher archives
522530
pushd $CJE_ROOT
523531
mkdir -p $ECLIPSE_BUILDER_DIR/equinox/$TMP_DIR
524532
mkdir -p $CJE_ROOT/$TMP_DIR
525533
$BASE_BUILDER_ECLIPSE_EXE \
526534
-application org.eclipse.ant.core.antRunner \
527-
-buildfile $ECLIPSE_BUILDER_DIR/equinox/helper.xml \
535+
-buildfile ${ECLIPSE_BUILDER_DIR}/equinox/buildConfigs/equinox-launchers/build.xml \
528536
-data $CJE_ROOT/$TMP_DIR/workspace-publishEquinox \
529-
-DEBuilderDir=$ECLIPSE_BUILDER_DIR \
530537
-DbuildDir=$BUILD_ID \
531538
-DbuildId=$BUILD_ID \
532539
-DbuildRepo=$PLATFORM_REPO_DIR \
533540
-DequinoxPostingDirectory=${EQUINOX_DROP_DIR} \
534-
-DeqpublishingContent=$ECLIPSE_BUILDER_DIR/equinox/publishingFiles \
535541
-Dequinox.build.configs=$ECLIPSE_BUILDER_DIR/equinox/buildConfigs \
536542
-Djava.io.tmpdir=$CJE_ROOT/$TMP_DIR \
537543
-v \
@@ -542,19 +548,9 @@ pipeline {
542548
bash ${CJE_ROOT}/scripts/produceChecksum.sh equinox
543549
popd
544550

545-
cp -r ${ECLIPSE_BUILDER_DIR}/equinox/publishingFiles/staticDropFiles/. ${EQUINOX_DROP_DIR}/${BUILD_ID}
546-
547551
java \
548-
-DisBuildTested=false \
549-
-DbuildType=${BUILD_TYPE} \
550-
-DdropTokenList='%equinox%,%framework%,%extrabundles%,%other%,%launchers%,%osgistarterkits%' \
551-
-DdropHtmlFileName=index.php \
552-
-DxmlDirectoryName=${DROP_DIR}/$BUILD_ID/testresults/xml \
553-
-DdropDirectoryName=${EQUINOX_DROP_DIR}/${BUILD_ID} \
554-
-DdropTemplateFileName=${ECLIPSE_BUILDER_DIR}/equinox/publishingFiles/templateFiles/index.template.php \
555-
-DcompileLogsDirectoryName=${EQUINOX_DROP_DIR}/${BUILD_ID}/compilelogs/plugins \
556-
-DtestManifestFileName=${ECLIPSE_BUILDER_DIR}/equinox/publishingFiles/testManifest.xml \
557-
${WORKSPACE}/scripts/releng/TestResultsGenerator.java
552+
-DdropDirectory=${EQUINOX_DROP_DIR}/${BUILD_ID} \
553+
${SCRIPTS}/releng/BuildDropDataGenerator.java mainEquinox
558554
'''
559555
}
560556
}
@@ -599,6 +595,9 @@ pipeline {
599595
}
600596
}
601597
stage('Archive build logs') {
598+
tools {
599+
jdk 'temurin-jdk25-latest'
600+
}
602601
steps {
603602
script {
604603
// See https://github.com/jenkinsci/pipeline-stage-view-plugin/tree/master/rest-api#get-jobjob-namewfapiruns
@@ -607,7 +606,7 @@ pipeline {
607606
for (jobStage in description['stages']) {
608607
if (jobStage.status != 'IN_PROGRESS') {
609608
def prefix = 's' + String.format('%03d', stageIndex++) // prefix with index to establish stable order
610-
def logFileName = "${logDir}/" + prefix + '_' + jobStage.name.replace(' ', '_').replace('Declarative:_', '') + '.log'
609+
def logFileName = "${DROP_DIR}/${BUILD_ID}/buildlogs/" + prefix + '_' + jobStage.name.replace(' ', '_').replace('Declarative:_', '') + '.log'
611610
sh """
612611
curl --fail --silent --output '${logFileName}' ${BUILD_URL}/pipeline-overview/log?nodeId=${jobStage.id}
613612
# Test (efficiently) if the file starts with the no-logs message and if yes, ensure it doesn't contain more other lines
@@ -620,8 +619,10 @@ pipeline {
620619
}
621620
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
622621
sh '''#!/bin/bash -xe
623-
dropPath=${EP_ECLIPSE_DROPS}/${BUILD_ID}
624-
scp -r $logDir/* [email protected]:${dropPath}/buildlogs/
622+
java \
623+
-DdropDirectory=${DROP_DIR}/${BUILD_ID} \
624+
${SCRIPTS}/releng/BuildDropDataGenerator.java buildLogs
625+
rsync -avzh ${DROP_DIR}/${BUILD_ID}/buildlogs/ [email protected]:${EP_ECLIPSE_DROPS}/${BUILD_ID}/buildlogs/
625626
'''
626627
}
627628
}

JenkinsJobs/Releng/promoteBuild.jenkinsfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ pipeline {
215215
-DnewPrevious-release.baseline="${RELEASE_P2_REPOSITORY}"
216216
'''
217217
utilities.replaceAllInFile('cje-production/buildproperties.txt', [
218-
'API_PREV_REF_LABEL=".*?"' : "API_PREV_REF_LABEL=\"${BUILD_MAJOR}.${BUILD_MINOR}\"",
219218
'PREVIOUS_RELEASE_VER=".*?"' : "PREVIOUS_RELEASE_VER=\"${BUILD_MAJOR}.${BUILD_MINOR}\"",
220219
'PREVIOUS_RELEASE_REPO_ID=".*?"' : "PREVIOUS_RELEASE_REPO_ID=\"${BUILD_MAJOR}.${BUILD_MINOR}\"",
221220
'BASEBUILD_ID=".*?"' : "BASEBUILD_ID=\"${DL_DROP_ID}\"",
@@ -371,11 +370,10 @@ EOF
371370
BUILD_ID: "${newBuildLabel}",
372371
BUILD_TYPE: "${DL_TYPE}",
373372
BUILD_TYPE_NAME: "${newTypeName}",
374-
BUILD_DIR_SEG: "${newDropID}",
375-
EQ_BUILD_DIR_SEG: "${newDropID}",
376373
]
377374
def buildPropertiesPHP = sh(returnStdout: true, script: "ssh [email protected] cat ${sourcePath}/buildproperties.php")
378375
for (entry in newProperties) {
376+
//TODO: update this to modify the buildproperties.json with the new names/labels and updated filenames/size(?)
379377
buildPropertiesPHP = buildPropertiesPHP.replaceFirst('\\$' + entry.key + ' = "[^"]+"', '\\$' + entry.key + ' = "' + entry.value + '"')
380378
}
381379
writeFile(file: 'buildproperties.php', text: buildPropertiesPHP)

0 commit comments

Comments
 (0)