Skip to content

Commit 7033ec9

Browse files
committed
[RelEng] Derive Maven deployment type from sourceRepository
This allows to remove the explicit 'snapshotOrRelease' parameter and simplifies invoking the job. The deployment type is derived from the sourceRepository URL. But as a safeguard the user is instead asked for confirmation if a 'release' deployment is detected.
1 parent a1cb4d1 commit 7033ec9

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

JenkinsJobs/Builds/build.jenkinsfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ spec:
317317
}
318318
steps {
319319
build job: 'Releng/PublishToMaven', wait: false, parameters: [
320-
string(name: 'snapshotOrRelease', value: 'snapshot'),
321320
string(name: 'sourceRepository', value: "https://download.eclipse.org/eclipse/updates/${RELEASE_VER}-${BUILD_TYPE}-builds/${BUILD_IID}")
322321
]
323322
}

JenkinsJobs/Releng/FOLDER.groovy

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ Releases are published to <a href="https://repo1.maven.org/maven2/org/eclipse/">
2121
<p>
2222
''')
2323
parameters { // Define parameters in job configuration to make them available even for the very first build after this job was (re)created.
24-
choiceParam('snapshotOrRelease', ['snapshot' /*default*/, 'release'], '''\
25-
If this is the publication of a snapshot or a release build.
24+
stringParam('sourceRepository', null, '''\
25+
The URL of the source P2 repository to be published.<br>
26+
For a snapshot publication, the 4.x-I-Builds child repository of the specific build should be specified, e.g. 'https://download.eclipse.org/eclipse/updates/4.37-I-builds/I20250710-1800/'<br>
27+
<b>To deploy a <em>Release</em>, the corresponding release repository should be specified</b>, e.g. 'https://download.eclipse.org/eclipse/updates/4.36/R-4.36-202505281830/'<br>
28+
If left blank (not recommended), the latest I-build is published.
2629
<ul>
2730
<li>
2831
Snapshots are published to <a href="https://repo.eclipse.org/content/repositories/eclipse-snapshots/">https://repo.eclipse.org/content/repositories/eclipse-snapshots/</a>.
@@ -31,12 +34,6 @@ Snapshots are published to <a href="https://repo.eclipse.org/content/repositorie
3134
Releases are published to <a href="https://repo1.maven.org/maven2/org/eclipse/">Maven central</a> by publishing to a <a href="https://oss.sonatype.org/#stagingRepositories">staging repository</a>.
3235
</li>
3336
</ul>
34-
''')
35-
stringParam('sourceRepository', null, '''\
36-
The URL of the source P2 repository to be published.<br>
37-
<b>If this is a <em>release</em> publication, the corresponding release repository should be specified</b>, e.g. 'https://download.eclipse.org/eclipse/updates/4.36/R-4.36-202505281830/'<br>
38-
For a snapshot publication, the 4.x-I-Builds child repository of the specific build should be specified, e.g. 'https://download.eclipse.org/eclipse/updates/4.37-I-builds/I20250710-1800/'<br>
39-
If left blank (not recommended), the latest I-build is published.
4037
''')
4138
}
4239
definition {

JenkinsJobs/Releng/publishToMaven.jenkinsfile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,29 @@ pipeline {
2222
}
2323
// parameters declared in the definition of the invoking job
2424
stages {
25+
stage('Determine Deployment type') {
26+
steps {
27+
script {
28+
if ("${sourceRepository}".trim() =~ /\/(?<version>\d+\.\d+)\/R-\k<version>(\.\d+)?-\d{12}(\/)?$/) {
29+
input message: 'The specified P2 repository is a release.', ok : 'Proceed and deploy it to Maven-Central staging'
30+
env.deploymentType = 'release'
31+
} else {
32+
env.deploymentType = 'snapshot'
33+
}
34+
}
35+
}
36+
}
2537
stage('Aggregate Maven repository') {
2638
steps {
27-
sh '''#!/bin/bash -e
39+
sh '''#!/bin/bash -xe
2840
FILE_SDK_AGGR="${WORKSPACE}/git-repo/eclipse.platform.releng/publish-to-maven-central/SDK4Mvn.aggr"
2941

3042
# Set the specified source repository
3143
if [ -n "${sourceRepository}" ]; then
3244
sed -e "s|<repositories location=\\".*\\">|<repositories location=\\"${sourceRepository}\\">|" -i ${FILE_SDK_AGGR}
3345
fi
3446
# Set whether this is a snapshot build or not
35-
if [ "${snapshotOrRelease}" != 'release' ]; then
47+
if [ "${deploymentType}" != 'release' ]; then
3648
sed -e 's/snapshot=".*"/snapshot="true"/g' -i ${FILE_SDK_AGGR}
3749
fi
3850

@@ -49,6 +61,7 @@ pipeline {
4961

5062
pushd ${REPO}
5163

64+
set -x
5265
echo "========== Repo aggregation completed ========="
5366

5467
# Find all the artifact folders for all projects

RELEASE.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ The actual steps to release
110110
- You can subscribe to [cross-project-issues](https://accounts.eclipse.org/mailing-list/cross-project-issues-dev) to get the notifications on Simrel releases.
111111
* #### **Publish to Maven central**
112112
- Publishing to maven should happen by at least Tuesday before the release since there is up to a 24 hour delay for the maven mirrors.
113-
- Run the [Publish to Maven](https://ci.eclipse.org/releng/job/Releng/job/PublishToMaven/) job in jenkins with the `release` parameter and the release build as `sourceRepository`.
113+
- Run the [Publish to Maven](https://ci.eclipse.org/releng/job/Releng/job/PublishToMaven/) job in Jenkins with the release build as `sourceRepository`.
114+
- About a minute after triggering the job, Jenkins will ask for confirmation on the console, if the specified build should really be deployed to Maven-Central staging.
114115
- Once that publish job has completed successfully, log into https://oss.sonatype.org/#stagingRepositories and close the Platform, JDT and PDE repositories.
115116
- If you do not have an account on oss.sonatype.org for performing the rest of the release request one by creating an issue like https://issues.sonatype.org/browse/OSSRH-43870 to get permissions for platform, JDT and PDE projects and tag an existing release engineer to give approval.
116117
* **Contribute to SimRel**
@@ -134,8 +135,6 @@ The release is scheduled for 10AM EST. Typically the jobs are scheduled beforeha
134135
- For the Y and P build parameters it's important to know whether or not Y and P builds were run during the release. Since they correspond to java releases on a 6 month cycle, typically they are built in odd-numbered releases.
135136
The existing builds are kept for one release, then cleaned up before the next stream that will have Y and P builds. it's convoluted and I dont want to type it out. Remove Y builds on even releases.
136137
- If something doesn't get cleaned up properly you can use Use the [list artifacts](https://ci.eclipse.org/releng/view/Cleanup/job/list_artifacts_from_download_server/) job to generate ta list of what's on the download server and either create a new job to clean it up or update and rerun the cleanup job as appropriate.
137-
* **Set Maven to Publish to I-builds**
138-
- Update [SDK4Mvn.aggr](https://github.com/eclipse-platform/eclipse.platform.releng/blob/master/publish-to-maven-central/SDK4Mvn.aggr) and point it to the new streams I-builds.
139138
* **Set Previous Release to GA**
140139
- Everything that was updated to RC2 (see below) should now use the released build.
141140

0 commit comments

Comments
 (0)