Skip to content

Commit f36adf8

Browse files
committed
Compute 'build type name' in build website's javascript
This simplifies the RelEng tasks and places the display logic where it's used.
1 parent 4b586aa commit f36adf8

File tree

4 files changed

+21
-14
lines changed

4 files changed

+21
-14
lines changed

JenkinsJobs/Releng/promoteBuild.jenkinsfile

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -352,18 +352,10 @@ EOF
352352
utilities.modifyJSON('buildproperties.json') { buildProperties ->
353353
buildProperties.identifier = newDropID
354354
buildProperties.label = newBuildLabel
355-
if ("${DL_TYPE}" == 'R') {
356-
buildProperties.kind = 'Release'
357-
} else if (newBuildLabel.contains('RC')) {
358-
buildProperties.kind = 'Release Candidate'
359-
} else if ("${DL_TYPE}" == 'S') {
360-
buildProperties.kind = 'Stable'
361-
} else {
362-
error "Unexpected DL_TYPE value, ${DL_TYPE}"
363-
}
364-
buildProperties.values().each{ value ->
355+
// Update filenames in lists
356+
for (value in buildProperties.values()) {
365357
if (value instanceof List) {
366-
value.each{ fileData ->
358+
for (fileData in value) {
367359
if('name' in fileData) {
368360
fileData.name = fileData.name.replace(oldBuildLabel, newBuildLabel)
369361
}

sites/eclipse/build/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<main>
1919

20-
<h2>Eclipse <span class="data-ref">${release}</span> <span class="data-ref">${kind}</span> Build: <span class="data-ref">${label}</span></h2>
20+
<h2>Eclipse <span class="data-ref">${release}</span> <span class="data-ref">${buildTypeName}</span> Build: <span class="data-ref">${label}</span></h2>
2121
<p id="build-state-container"></p>
2222
<p>
2323
This page provides access to the various deliverables of Eclipse Platform build along with its logs and tests.
@@ -109,6 +109,7 @@ <h3 id="swt">SWT Binary and Source
109109
</main>
110110
<script>
111111
loadPageData('buildproperties.json', data => {
112+
data.buildTypeName = getBuildTypeName(data)
112113
data.updatesP2RepositoryComposite = `https://download.eclipse.org/eclipse/updates/${data.releaseShort}`
113114
const buildID = data.identifier
114115
const buildType = buildID.charAt(0)

sites/eclipse/page.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ function getBuildType(buildData) {
5555
return buildData.identifier.startsWith('Y') ? 'Y' : 'I'
5656
}
5757

58+
function getBuildTypeName(buildData) {
59+
const identifier = buildData.identifier
60+
if (identifier.startsWith('R-')) {
61+
return 'Release'
62+
} else if (identifier.startsWith('S-')) {
63+
return identifier.includes('RC') ? 'Release Candidate' : 'Stable'
64+
} else {
65+
return buildData.kind
66+
}
67+
}
68+
5869
function getWS(os) {
5970
if (os == 'win32') {
6071
return 'win32'

sites/equinox/build/index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</div>
1919

2020
<main>
21-
<h2>Equinox <span class="data-ref">${kind}</span> Build: <span class="data-ref">${label}</span></h2>
21+
<h2>Equinox <span class="data-ref">${buildTypeName}</span> Build: <span class="data-ref">${label}</span></h2>
2222
<p id="build-state-container"></p>
2323

2424
<span id="build-timestamp"></span>
@@ -65,7 +65,10 @@ <h3 id="other">Other Information</h3>
6565

6666
</main>
6767
<script>
68-
loadPageData('buildproperties.json')
68+
loadPageData('buildproperties.json', data => {
69+
data.buildTypeName = getBuildTypeName(data)
70+
return data
71+
})
6972

7073
contentPostProcessor = (mainElement, build) => {
7174
document.title = `Equinox - ${build.label}`

0 commit comments

Comments
 (0)