Skip to content

Commit 9d62e9a

Browse files
committed
[Build] Inline makeVisible.sh script and simplify the Make Visible job
Also combine all parameters into one, which simplifies starting the job and simplifies its initialization.
1 parent c832cc1 commit 9d62e9a

File tree

4 files changed

+94
-217
lines changed

4 files changed

+94
-217
lines changed

JenkinsJobs/Releng/FOLDER.groovy

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,19 +149,16 @@ GitHub issue to track tagging the release, for example:
149149
pipelineJob('Releng/makeVisible'){
150150
displayName('Make Visible')
151151
description('''\
152-
The first part of doing a promotion -- the Rename And Promote job -- creates some scripts that make this deferred "make visible" part possible.
153-
Therefore, they have to share a 'workspace', and the output of the first job must remain in place until its time to "make visible".
152+
Make a 'release build', which was previously declared by running the 'Rename And Promote' job, visible.
153+
The first part of a promotion -- the 'Rename And Promote' job -- puts the build at its final location, but keeps it hidden.
154+
Therefore, both jobs have to share a 'workspace', and the output of the first job must remain in place until its time to "make visible".
154155
''')
155156
parameters {
156-
stringParam('DROP_ID', null, '''\
157-
The name (or, build id) of the build to rename and promote. Typically would be a value such as I20160530-2000 or M20160912-1000.
158-
It must match the name of the build on the build machine.
157+
stringParam('releaseBuildID', null, '''\
158+
The id of the 'milestone', 'release-candidate' or 'GA-release' build to make visible.
159+
Typically would be a value such as 'S-4.26M1-202209281800' or 'R-4.36-202505281830'.
160+
It must match the name of the build on the download server.
159161
''')
160-
stringParam('CHECKPOINT', null, 'M1, M3, RC1, RC2, RC3 etc (blank for final releases).')
161-
stringParam('SIGNOFF_BUG', null, 'The issue that was used to "signoff" the checkpoint. If there are no unit test failures, this can be left blank. Otherwise a link is added to test page explaining that "failing unit tests have been investigated".')
162-
stringParam('TRAIN_NAME', null, 'The name of the release stream, typically yyyy-mm. For example: 2022-09')
163-
stringParam('STREAM', null, 'Needs to be all three files of primary version for the release, such as 4.7.1 or 4.8.0.')
164-
stringParam('DL_TYPE', null, "This is the build type we are promoting TO. I-builds promote to 'S' until 'R'.")
165162
}
166163
definition {
167164
cpsScm {

JenkinsJobs/Releng/makeVisible.jenkinsfile

Lines changed: 85 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,96 @@ pipeline {
99
label 'basic'
1010
}
1111
stages {
12-
stage('Make visible') {
12+
stage('Process Input') {
1313
steps {
14-
sshagent(['projects-storage.eclipse.org-bot-ssh', 'github-bot-ssh']) {
15-
sh '''
16-
curl -o makeVisible.sh https://download.eclipse.org/eclipse/relengScripts/cje-production/promotion/makeVisible.sh
17-
chmod +x makeVisible.sh
18-
./makeVisible.sh
14+
script {
15+
if (!params.releaseBuildID) {
16+
error "Required parameter 'releaseBuildID' is not defined."
17+
}
18+
env.RELEASE_ID = params.releaseBuildID.trim()
19+
def releaseIDMatcher = RELEASE_ID =~ /(?<type>[SR])-(?<major>\d+)\.(?<minor>\d+)(.\d+)?((M|RC)\d+[a-z]?)?-\d{12}/
20+
if (!releaseIDMatcher.matches()) {
21+
error "releaseID: ${RELEASE_ID}, does not match the expected pattern."
22+
}
23+
env.RELEASE_TYPE = releaseIDMatcher.group('type')
24+
env.RELEASE_VERSION_MAJOR = releaseIDMatcher.group('major')
25+
env.RELEASE_VERSION_MINOR = releaseIDMatcher.group('minor')
26+
dropIDMatcher = null // release matcher as it's not serializable
27+
}
28+
sh '''
29+
echo 'Input parameters read successfully'
30+
echo "RELEASE_ID='$RELEASE_ID'"
31+
echo "RELEASE_TYPE='$RELEASE_TYPE'"
32+
echo "RELEASE_VERSION_MAJOR='$RELEASE_VERSION_MAJOR'"
33+
echo "RELEASE_VERSION_MINOR='$RELEASE_VERSION_MINOR'"
34+
'''
35+
}
36+
}
37+
stage('Make Download page visible') {
38+
steps {
39+
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
40+
sh '''#!/bin/bash -xe
41+
# Build machine locations (would very seldom change)
42+
DOWNLOAD_ROOT=${DOWNLOAD_ROOT:-/home/data/httpd/download.eclipse.org}
43+
ARCHIVE_ROOT=${ARCHIVE_ROOT:-/home/data/httpd/archive.eclipse.org}
44+
ECLIPSE_MARKER="eclipse/downloads/drops4/${RELEASE_ID}/buildHidden"
45+
EQUINOX_MARKER="equinox/drops/${RELEASE_ID}/buildHidden"
46+
SSH_PREFIX="ssh [email protected]"
47+
48+
${SSH_PREFIX} rm --force "${DOWNLOAD_ROOT}/${ECLIPSE_MARKER}"
49+
${SSH_PREFIX} rm --force "${DOWNLOAD_ROOT}/${EQUINOX_MARKER}"
50+
51+
if [[ "${RELEASE_TYPE}" == 'R' ]]; then
52+
${SSH_PREFIX} rm --force "${ARCHIVE_ROOT}/${ECLIPSE_MARKER}"
53+
${SSH_PREFIX} rm --force "${ARCHIVE_ROOT}/${EQUINOX_MARKER}"
54+
fi
1955
'''
2056
}
2157
build job: 'Releng/updateIndex', wait: false
2258
}
2359
}
60+
stage('Make Release Repository visible') {
61+
when {
62+
environment name: 'RELEASE_TYPE', value: 'R'
63+
}
64+
steps {
65+
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
66+
sh '''
67+
#Repository will be available only for R builds. add it to composite
68+
epDownloadDir=/home/data/httpd/download.eclipse.org/eclipse
69+
dropsPath=${epDownloadDir}/downloads/drops4
70+
workingDir=${epDownloadDir}/workingDir
71+
72+
workspace=${workingDir}/${JOB_NAME}-${BUILD_NUMBER}
73+
74+
ssh [email protected] rm -rf ${workingDir}/${JOB_NAME}*
75+
76+
ssh [email protected] mkdir -p ${workspace}
77+
ssh [email protected] cd ${workspace}
78+
79+
#get latest Eclipse platform product
80+
epRelDir=$(ssh [email protected] ls -d --format=single-column ${dropsPath}/R-*|sort|tail -1)
81+
ssh [email protected] tar -C ${workspace} -xzf ${epRelDir}/eclipse-platform-*-linux-gtk-x86_64.tar.gz
82+
83+
#get requisite tools
84+
ssh [email protected] wget -O ${workspace}/addToComposite.xml https://download.eclipse.org/eclipse/relengScripts/cje-production/scripts/addToComposite.xml
85+
86+
#triggering ant runner
87+
baseBuilderDir=${workspace}/eclipse
88+
javaCMD=/opt/public/common/java/openjdk/jdk-21_x64-latest/bin/java
89+
launcherJar=$(ssh [email protected] find ${baseBuilderDir}/. -name "org.eclipse.equinox.launcher_*.jar" | sort | head -1 )
90+
91+
repoDir=/"home/data/httpd/download.eclipse.org/eclipse/updates/${BUILD_MAJOR}.${BUILD_MINOR}"
92+
93+
devWorkspace=${workspace}/workspace-antRunner
94+
devArgs=-Xmx512m
95+
extraArgs="addToComposite -Drepodir=${repoDir} -Dcomplocation=${RELEASE_ID}"
96+
ssh [email protected] ${javaCMD} -jar ${launcherJar} -nosplash -consolelog -debug -data $devWorkspace -application org.eclipse.ant.core.antRunner -file ${workspace}/addToComposite.xml ${extraArgs} -vmargs $devArgs
97+
98+
ssh [email protected] rm -rf ${workingDir}/${JOB_NAME}*
99+
'''
100+
}
101+
}
102+
}
24103
}
25104
}

RELEASE.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@
5454
4. Update the Location property to the "Specific repository for building against" in the mailtemplate.txt from promotion.
5555
5. Commit Simrel updates to Gerrit
5656
- Message should use year-month format, i.e "Simrel updates for Eclipse and Equinox for 2022-06 M1"
57-
* Make the build visible
58-
- Run the [Make Visible](https://ci.eclipse.org/releng/job/Releng/job/makeVisible/) job in Releng jenkins to make the promoted build visible on the download page.
59-
- Parameters should match `Rename and Promote` job
57+
* Run the [Make Visible](https://ci.eclipse.org/releng/job/Releng/job/makeVisible/) job in Releng jenkins to make the promoted build visible on the download page.
58+
- `releaseBuildID`: the full id of the milestone, release-candidate or release build to make visible, e.g. `S-4.26M1-202209281800` or `R-4.36-202505281830`
6059
* Send email that the M1 build is available
6160
- Use the mail template from the promotion build [artifacts](https://ci.eclipse.org/releng/job/Releng/job/renameAndPromote/lastSuccessfulBuild/artifact/) in Jenkins to get the download urls.
6261
- Make sure to mention that the Master branch is now again open for development.

cje-production/promotion/makeVisible.sh

Lines changed: 0 additions & 198 deletions
This file was deleted.

0 commit comments

Comments
 (0)