Skip to content

Commit ceccb93

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 ceccb93

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-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: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pipeline {
1414
maven 'maven-daemon'
1515
}
1616
environment {
17+
DEPLOYMENT_TYPE = determineDeploymentType()
1718
REPO = "${WORKSPACE}/repo"
1819
CBI_AGGR = "${installLatestCbiAggr()}"
1920
// Folder ~/.m2 is not writable for builds, ensure mvnd metadata are written within the workspace.
@@ -24,15 +25,15 @@ pipeline {
2425
stages {
2526
stage('Aggregate Maven repository') {
2627
steps {
27-
sh '''#!/bin/bash -e
28+
sh '''#!/bin/bash -xe
2829
FILE_SDK_AGGR="${WORKSPACE}/git-repo/eclipse.platform.releng/publish-to-maven-central/SDK4Mvn.aggr"
2930

3031
# Set the specified source repository
3132
if [ -n "${sourceRepository}" ]; then
3233
sed -e "s|<repositories location=\\".*\\">|<repositories location=\\"${sourceRepository}\\">|" -i ${FILE_SDK_AGGR}
3334
fi
3435
# Set whether this is a snapshot build or not
35-
if [ "${snapshotOrRelease}" != 'release' ]; then
36+
if [ "${DEPLOYMENT_TYPE}" != 'release' ]; then
3637
sed -e 's/snapshot=".*"/snapshot="true"/g' -i ${FILE_SDK_AGGR}
3738
fi
3839

@@ -49,6 +50,7 @@ pipeline {
4950

5051
pushd ${REPO}
5152

53+
set +x
5254
echo "========== Repo aggregation completed ========="
5355

5456
# Find all the artifact folders for all projects
@@ -179,6 +181,15 @@ pipeline {
179181
}
180182
}
181183

184+
def determineDeploymentType() {
185+
if ("${sourceRepository}".trim() =~ /\/(?<version>\d+\.\d+)\/R-\k<version>(\.\d+)?-\d{12}(\/)?$/) {
186+
input message: 'The specified P2 repository is a release and will be deployed to Maven-Central.', ok : 'Proceed deploying to Maven-Central'
187+
return 'release'
188+
} else {
189+
return 'snapshot'
190+
}
191+
}
192+
182193
def installLatestCbiAggr(){
183194
return install('cbiAggr', "https://download.eclipse.org/cbi/updates/p2-aggregator/products/nightly/latest/org.eclipse.cbi.p2repo.cli.product-linux.gtk.x86_64.tar.gz") + '/cbiAggr'
184195
}

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)