Skip to content

Commit db112df

Browse files
committed
[RelEng] Unify and improve redirection pages on Downloads sites
This effectively puts the redirections towards https://download.eclipse.org/eclipse/downloads/ under version control, which are placed at: - https://download.eclipse.org/eclipse/index.html - https://download.eclipse.org/eclipse/downloads/drops4/index.html and improves their content to also provide a readable message and to redirect immediately and to the directory. Before it was - at download.eclipse.org/eclipse/index.html ''' <meta http-equiv="Refresh" content="1; URL=downloads/"> ''' - at download.eclipse.org/eclipse/downloads/drops4/index.html ''' <meta http-equiv="Refresh" content="0; URL=../index.html"> ''' Furthermore, in the updateIndex pipeline, enhance the remote rsync invocation to consider file-checksums when determining changes to avoid repeated overwrites of rarely changing files.
1 parent 0c1b585 commit db112df

3 files changed

Lines changed: 24 additions & 15 deletions

File tree

JenkinsJobs/Releng/publishPromotedBuild.jenkinsfile

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,7 @@ pipeline {
119119
]
120120

121121
// Update html redirect to latest release updates repository
122-
writeFile(file: 'index.html', text: """\
123-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
124-
<html>
125-
<head>
126-
<title>Eclipse</title>
127-
<meta http-equiv="Cache-control" content="no-cache, no-store, must-revalidate">
128-
<meta http-equiv="REFRESH" content="0;url=https://download.eclipse.org/eclipse/updates/${RELEASE_VERSION_MAJOR}.${RELEASE_VERSION_MINOR}/" />
129-
</head>
130-
<body>
131-
This page will redirect to the <a href="https://download.eclipse.org/eclipse/updates/${RELEASE_VERSION_MAJOR}.${RELEASE_VERSION_MINOR}/">Eclipse latest release</a> repository.
132-
</body>
133-
</html>
134-
""".stripIndent())
122+
writeFile(file: 'index.html', text: utilities.redirectionPage("${RELEASE_VERSION_MAJOR}.${RELEASE_VERSION_MINOR}", 'Eclipse Updates', 'latest Eclipse release repository'))
135123
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
136124
sh 'scp index.html genie.releng@projects-storage.eclipse.org:${DOWNLOAD_ROOT}/eclipse/updates/'
137125
}

JenkinsJobs/Releng/updateIndex.jenkinsfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,18 @@ pipeline {
8989
utilities.writeJSON('site-eclipse/data.json', eclipseOverviewData)
9090
def equinoxOverviewData = parseEquinoxBuildDrops(dropData[1])
9191
utilities.writeJSON('site-equinox/data.json', equinoxOverviewData)
92+
93+
// Redirection pages towards the eclipse downloads overview page
94+
writeFile(file: 'downloads-index.html', text: utilities.redirectionPage('downloads', 'Eclipse Downloads'))
95+
writeFile(file: 'drops4-index.html', text: utilities.redirectionPage('..', 'Eclipse Downloads'))
9296
}
9397
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
9498
sh '''
95-
rsync -rvzh site-eclipse/. genie.releng@projects-storage.eclipse.org:${EP_ROOT}/eclipse/downloads/
96-
rsync -rvzh site-equinox/. genie.releng@projects-storage.eclipse.org:${EP_ROOT}/equinox/
99+
rsync -rvzh --checksum site-eclipse/. genie.releng@projects-storage.eclipse.org:${EP_ROOT}/eclipse/downloads/
100+
rsync -rvzh --checksum site-equinox/. genie.releng@projects-storage.eclipse.org:${EP_ROOT}/equinox/
101+
102+
rsync -rvzh --checksum downloads-index.html genie.releng@projects-storage.eclipse.org:${EP_ROOT}/eclipse/index.html
103+
rsync -rvzh --checksum drops4-index.html genie.releng@projects-storage.eclipse.org:${EP_ROOT}/eclipse/downloads/drops4/index.html
97104
'''
98105
}
99106
}

JenkinsJobs/shared/utilities.groovy

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,20 @@ def copyStaticWebsiteFiles(String gitRoot, String website) {
123123
"""
124124
}
125125

126+
def redirectionPage(String redirectionTarget, String title, String targetName = null) {
127+
return """
128+
<!DOCTYPE html>
129+
<head>
130+
<title>${title}</title>
131+
<meta http-equiv="refresh" content="0;url=${redirectionTarget}">
132+
</head>
133+
<body>
134+
Redirection to <a href="${redirectionTarget}">${targetName ?: title}</a>.
135+
</body>
136+
</html>
137+
""".stripIndent()
138+
}
139+
126140
// --- git operations ---
127141

128142
def runHereAndForEachGitSubmodule(Closure task) {

0 commit comments

Comments
 (0)