Skip to content

Commit 65d0302

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. In order to simplify the release process, the P2-repositories produced by I-builds alredy have their final name set. Fixes #3201
1 parent 16ca898 commit 65d0302

File tree

3 files changed

+37
-70
lines changed

3 files changed

+37
-70
lines changed

JenkinsJobs/Releng/promoteBuild.jenkinsfile

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ pipeline {
6060
assignEnvVariable('BUILD_SERVICE', versionMatcher.group('service'))
6161
versionMatcher = null // release matcher as it's not serializable
6262

63+
assignEnvVariable('BUILD_REPO_ORIGINAL', "${BUILD_MAJOR}.${BUILD_MINOR}-${REPO_BUILD_TYPE}-builds")
64+
6365
if ("${CHECKPOINT}" ==~ /M\d+([a-z])?/ || "${CHECKPOINT}" ==~ /RC\d+([a-z])?/) { // milestone or RC promotion
6466
assignEnvVariable('DL_TYPE', 'S')
6567
// REPO_SITE_SEGMENT variale not used in this case
@@ -97,8 +99,6 @@ pipeline {
9799
environment {
98100
BUILDMACHINE_BASE_DL = "${EP_ECLIPSE_ROOT}/downloads/drops4"
99101
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}"
102102
// Eclipse and Equinox drop Site (final segment)
103103
ECLIPSE_DL_DROP_DIR_SEGMENT = "${DL_TYPE}-${DL_LABEL}-${BUILD_TIMESTAMP}"
104104
EQUINOX_DL_DROP_DIR_SEGMENT = "${DL_TYPE}-${DL_LABEL_EQ}-${BUILD_TIMESTAMP}"
@@ -138,6 +138,36 @@ pipeline {
138138
]
139139
}
140140
}
141+
stage('Promote P2 Repository') {
142+
when {
143+
environment name: 'DL_TYPE', value: 'R'
144+
}
145+
steps {
146+
dir("${WORKSPACE}/updates") {
147+
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
148+
sh '''#!/bin/bash -xe
149+
MIRROR_URL="https://www.eclipse.org/downloads/download.php?format=xml&file=/eclipse/updates/${REPO_SITE_SEGMENT}/${DL_DROP_ID}"
150+
sourceRepository="${EP_ECLIPSE_ROOT}/updates/${BUILD_REPO_ORIGINAL}/${REPO_ID}"
151+
targetRepository="${EP_ECLIPSE_ROOT}/updates/${REPO_SITE_SEGMENT}/${DL_DROP_ID}"
152+
ssh [email protected] "cp -r '${sourceRepository}' '${targetRepository}'"
153+
154+
JAR_FILE='artifacts.jar'
155+
XML_FILE='artifacts.xml'
156+
scp -r [email protected]:${targetRepository}/${JAR_FILE} .
157+
158+
jar --extract "--file=${JAR_FILE}"
159+
sed -i --expression "s|<p2_mirrorsURL_PLACEHOLDER></p2_mirrorsURL_PLACEHOLDER>|${MIRROR_URL}|g" "${XML_FILE}"
160+
161+
jar --create --no-manifest --file=${JAR_FILE} "${XML_FILE}"
162+
xz --extreme --force --keep "${XML_FILE}"
163+
164+
scp "${JAR_FILE}" [email protected]:${targetRepository}
165+
scp "${XML_FILE}.xz" [email protected]:${targetRepository}
166+
'''
167+
}
168+
}
169+
}
170+
}
141171
}
142172
post {
143173
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.releng.tychoeclipsebuilder/eclipse.platform.repository/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
<configuration>
5151
<includeAllDependencies>true</includeAllDependencies>
5252
<includeAllSources>true</includeAllSources>
53+
<repositoryName>Eclipse ${releaseVersion} repository (for ${releaseYear}-${releaseMonth})</repositoryName>
54+
<extraArtifactRepositoryProperties>
55+
<p2.statsURI>https://download.eclipse.org/stats</p2.statsURI>
56+
<p2_mirrorsURL_PLACEHOLDER/> <!-- To be replaced with the real p2.mirrorsURL upon release -->
57+
</extraArtifactRepositoryProperties>
5358
</configuration>
5459
</plugin>
5560
<plugin>

0 commit comments

Comments
 (0)