Skip to content

Commit 383ae3a

Browse files
committed
[RelEng] Simplify creation of release P2 repo and restore its mirrorsURL
Since 4.28 respectively 2023-06 the property 'p2.mirrorsURL' is not added to release repositories anymore, which effectively disables the use of mirrors. This happened accidentally because the JDKs installed at the Jenkins agents running the release process became insufficient then. Instead of just providing the JDK, the whole approach to add this property is reworked: - The property is added using Maven and the new tycho mojo 'tycho-p2-repository:modify-repository-properties' - The repo is copied diretly on the download-server from the source to its target location. Only the artifacts.jar/xml.xz files are downloaded to the build workspace, modified as described above and then copied back to the target location. In order to simplify the release process, the P2-repositories produced by I-builds already have their final name set. Fixes #3201
1 parent f71ea28 commit 383ae3a

File tree

4 files changed

+63
-73
lines changed

4 files changed

+63
-73
lines changed

JenkinsJobs/Releng/promoteBuild.jenkinsfile

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ pipeline {
1111
environment {
1212
HIDE_SITE = 'true'
1313
// Download Server locations (would very seldom change)
14-
BUILD_ROOT = '/home/data/httpd/download.eclipse.org'
15-
EP_ECLIPSE_ROOT = "${BUILD_ROOT}/eclipse"
16-
EP_EQUINOX_ROOT = "${BUILD_ROOT}/equinox"
14+
EP_ROOT = '/home/data/httpd/download.eclipse.org'
15+
EP_ECLIPSE_ROOT = "${EP_ROOT}/eclipse"
16+
EP_EQUINOX_ROOT = "${EP_ROOT}/equinox"
17+
}
18+
tools {
19+
jdk 'temurin-jdk21-latest'
20+
maven 'apache-maven-latest'
1721
}
1822
stages {
1923
stage('Process input') {
@@ -60,6 +64,8 @@ pipeline {
6064
assignEnvVariable('BUILD_SERVICE', versionMatcher.group('service'))
6165
versionMatcher = null // release matcher as it's not serializable
6266

67+
assignEnvVariable('BUILD_REPO_ORIGINAL', "${BUILD_MAJOR}.${BUILD_MINOR}-${REPO_BUILD_TYPE}-builds")
68+
6369
if ("${CHECKPOINT}" ==~ /M\d+([a-z])?/ || "${CHECKPOINT}" ==~ /RC\d+([a-z])?/) { // milestone or RC promotion
6470
assignEnvVariable('DL_TYPE', 'S')
6571
// REPO_SITE_SEGMENT variale not used in this case
@@ -97,8 +103,6 @@ pipeline {
97103
environment {
98104
BUILDMACHINE_BASE_DL = "${EP_ECLIPSE_ROOT}/downloads/drops4"
99105
BUILDMACHINE_BASE_EQ = "${EP_EQUINOX_ROOT}/drops"
100-
BUILD_REPO_ORIGINAL = "${BUILD_MAJOR}.${BUILD_MINOR}-${REPO_BUILD_TYPE}-builds"
101-
BUILDMACHINE_BASE_SITE = "${EP_ECLIPSE_ROOT}/updates/${BUILD_REPO_ORIGINAL}"
102106
// Eclipse and Equinox drop Site (final segment)
103107
ECLIPSE_DL_DROP_DIR_SEGMENT = "${DL_TYPE}-${DL_LABEL}-${BUILD_TIMESTAMP}"
104108
EQUINOX_DL_DROP_DIR_SEGMENT = "${DL_TYPE}-${DL_LABEL_EQ}-${BUILD_TIMESTAMP}"
@@ -138,6 +142,38 @@ pipeline {
138142
]
139143
}
140144
}
145+
stage('Promote P2 Repository') {
146+
when {
147+
environment name: 'DL_TYPE', value: 'R'
148+
}
149+
steps {
150+
dir("${WORKSPACE}/updates") {
151+
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
152+
sh '''#!/bin/bash -xe
153+
git clone --depth=1 --filter=tree:0 --no-checkout --branch=master https://github.com/eclipse-platform/eclipse.platform.releng.aggregator.git
154+
pushd eclipse.platform.releng.aggregator
155+
git sparse-checkout set --no-cone eclipse-platform-parent/pom.xml
156+
git checkout
157+
popd
158+
159+
sourceRepo="eclipse/updates/${BUILD_REPO_ORIGINAL}/${REPO_ID}"
160+
targetRepo="eclipse/updates/${REPO_SITE_SEGMENT}/${DL_DROP_ID}"
161+
ssh [email protected] cp -r "${EP_ROOT}/${sourceRepo}/." "${EP_ROOT}/${targetRepo}"
162+
163+
MIRRORS_URL="https://www.eclipse.org/downloads/download.php?file=/${targetRepo}"
164+
mvn tycho-p2-repository:modify-repository-properties -Pp2-repository-modification \\
165+
--file eclipse.platform.releng.aggregator/eclipse-platform-parent/ \\
166+
-Dp2.repository.location=https://download.eclipse.org/${sourceRepo}/ \\
167+
-Dp2.repository.output=$(pwd)/output \\
168+
-Dp2.repository.kind=artifact \\
169+
-Dp2.repository.mirrorsURL=${MIRRORS_URL}
170+
171+
scp output/artifacts.* [email protected]:${EP_ROOT}/${targetRepo}
172+
'''
173+
}
174+
}
175+
}
176+
}
141177
}
142178
post {
143179
always {

cje-production/promotion/promoteSites.sh

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -188,65 +188,13 @@ function renameBuild ()
188188
done
189189
}
190190

191-
function createBaseBuilder ()
192-
{
193-
epRelDir=$(ssh [email protected] ls -d --format=single-column ${BUILDMACHINE_BASE_DL}/R-*|sort|tail -1)
194-
BASEBUILDER_DIR=${WORKSPACE}/basebuilder
195-
export BASEBUILDER_DIR
196-
mkdir -p ${BASEBUILDER_DIR}
197-
mkdir -p ${WORKSPACE}/tempEclipse
198-
pushd ${WORKSPACE}/tempEclipse
199-
scp [email protected]:${epRelDir}/eclipse-platform-*-linux-gtk-x86_64.tar.gz eclipse-platform.tar.gz
200-
tar xvzf eclipse-platform.tar.gz
201-
${WORKSPACE}/tempEclipse/eclipse/eclipse -nosplash \
202-
-debug -consolelog -data ${WORKSPACE}/workspace-toolsinstall \
203-
-application org.eclipse.equinox.p2.director \
204-
-repository "https://download.eclipse.org/eclipse/updates/latest/","https://download.eclipse.org/eclipse/updates/buildtools/",${WEBTOOLS_REPO} \
205-
-installIU org.eclipse.platform.ide,org.eclipse.pde.api.tools,org.eclipse.releng.build.tools.feature.feature.group,org.eclipse.wtp.releng.tools.feature.feature.group \
206-
-destination ${BASEBUILDER_DIR} \
207-
-profile SDKProfile
208-
popd
209-
export ECLIPSE_EXE=${BASEBUILDER_DIR}/eclipse
210-
rm -rf ${WORKSPACE}/tempEclipse
211-
}
212-
213-
function addRepoProperties ()
214-
{
215-
APP_NAME=org.eclipse.wtp.releng.tools.addRepoProperties
216-
devworkspace=${devworkspace:-${WORKSPACE}/workspaceAddRepoProperties}
217-
218-
REPO=$1
219-
REPO_TYPE=$2
220-
BUILD_ID=$3
221-
222-
createBaseBuilder
223-
MIRRORURL=/eclipse/updates/${REPO_TYPE}/${BUILD_ID}
224-
MIRRORURL_ARG="https://www.eclipse.org/downloads/download.php?format=xml&file=${MIRRORURL}"
225-
226-
ART_REPO_NAME="Eclipse Project Repository for ${TRAIN_NAME}"
227-
CON_REPO_NAME="Eclipse Project Repository for ${TRAIN_NAME}"
228-
229-
MIRRORS_URL_ARG=-Dp2MirrorsURL=${MIRRORURL_ARG}
230-
ART_REPO_ARG=-DartifactRepoDirectory=${REPO}
231-
CON_REPO_ARG=-DmetadataRepoDirectory=${REPO}
232-
ART_REPO_NAME_ARG=-Dp2ArtifactRepositoryName=\"${ART_REPO_NAME}\"
233-
CON_REPO_NAME_ARG=-Dp2MetadataRepositoryName=\"${CON_REPO_NAME}\"
234-
235-
${ECLIPSE_EXE} --launcher.suppressErrors -nosplash -consolelog -debug -data ${devworkspace} -application ${APP_NAME} -vmargs ${MIRRORS_URL_ARG} -Dp2ArtifactRepositoryName="${ART_REPO_NAME}" -Dp2MetadataRepositoryName="${CON_REPO_NAME}" ${ART_REPO_ARG} ${CON_REPO_ARG}
236-
}
237-
238-
# Extract WEBTOOLS_REPO and other variables from buildproperties.shsource for the build
239-
source ${WORKSPACE}/buildproperties.shsource
240-
241191
# Main promotion scripts starts here
242192

243193
#Take backup of current build
244194
LOCAL_EP_DIR=${WORKSPACE}/eclipse
245195
LOCAL_EQ_DIR=${WORKSPACE}/equinox
246-
LOCAL_REPO=${WORKSPACE}/updates
247196
mkdir -p ${LOCAL_EP_DIR}
248197
mkdir -p ${LOCAL_EQ_DIR}
249-
mkdir -p ${LOCAL_REPO}
250198

251199
pushd ${LOCAL_EP_DIR}
252200
scp -r [email protected]:${BUILDMACHINE_BASE_DL}/${DROP_ID} .
@@ -256,10 +204,6 @@ pushd ${LOCAL_EQ_DIR}
256204
scp -r [email protected]:${BUILDMACHINE_BASE_EQ}/${DROP_ID_EQ} .
257205
popd
258206

259-
pushd ${LOCAL_REPO}
260-
scp -r [email protected]:${BUILDMACHINE_BASE_SITE}/${REPO_ID} .
261-
popd
262-
263207
# ### Begins the point of making modifications to the build ###
264208
if [[ "${DL_TYPE}" != "R" ]]
265209
then
@@ -323,15 +267,3 @@ pushd ${LOCAL_EP_DIR}
323267
fi
324268

325269
popd
326-
327-
328-
#Promote Repository
329-
if [[ "${DL_TYPE}" == "R" ]]
330-
then
331-
pushd ${LOCAL_REPO}
332-
BUILDMACHINE_SITE=${LOCAL_REPO}/${REPO_ID}
333-
addRepoProperties ${BUILDMACHINE_SITE} ${REPO_SITE_SEGMENT} ${DL_DROP_ID}
334-
mv ${REPO_ID} ${DL_DROP_ID}
335-
scp -r ${LOCAL_REPO}/${DL_DROP_ID} [email protected]:${EP_ECLIPSE_ROOT}/updates/${REPO_SITE_SEGMENT}
336-
popd
337-
fi

eclipse-platform-parent/pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,27 @@
11151115
</pluginManagement>
11161116
</build>
11171117
</profile>
1118+
<profile>
1119+
<id>p2-repository-modification</id>
1120+
<build>
1121+
<pluginManagement>
1122+
<plugins>
1123+
<plugin>
1124+
<groupId>org.eclipse.tycho</groupId>
1125+
<artifactId>tycho-p2-repository-plugin</artifactId>
1126+
<configuration><!-- Properties will be defined on the CLI. -->
1127+
<repository>
1128+
<url>${p2.repository.location}</url>
1129+
</repository>
1130+
<propertiesToAdd>
1131+
<p2.mirrorsURL>${p2.repository.mirrorsURL}</p2.mirrorsURL>
1132+
</propertiesToAdd>
1133+
</configuration>
1134+
</plugin>
1135+
</plugins>
1136+
</pluginManagement>
1137+
</build>
1138+
</profile>
11181139
</profiles>
11191140
<scm>
11201141
<connection>scm:git:https://github.com/eclipse-platform/eclipse.platform.releng.aggregator.git</connection>

eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<configuration>
5151
<includeAllDependencies>true</includeAllDependencies>
5252
<includeAllSources>true</includeAllSources>
53+
<repositoryName>Eclipse ${releaseVersion} repository (for ${releaseYear}-${releaseMonth})</repositoryName>
5354
</configuration>
5455
</plugin>
5556
<plugin>

0 commit comments

Comments
 (0)