Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions JenkinsJobs/Builds/build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,7 @@ spec:
}
}
steps {
build job: 'Releng/PublishToMaven', wait: false, parameters: [
string(name: 'snapshotOrRelease', value: 'snapshot'),
build job: 'Releng/deployToMaven', wait: false, parameters: [
string(name: 'sourceRepository', value: "https://download.eclipse.org/eclipse/updates/${RELEASE_VER}-${BUILD_TYPE}-builds/${BUILD_IID}")
]
}
Expand Down
31 changes: 14 additions & 17 deletions JenkinsJobs/Releng/FOLDER.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,38 @@ folder('Releng') {
description('Jobs related to routine releng tasks. Some are periodic, some are "manual" jobs ran only when needed.')
}

pipelineJob('Releng/PublishToMaven'){
displayName('Publish to Maven')
pipelineJob('Releng/deployToMaven'){
displayName('Deploy to Maven')
description('''\
<p>
This job uses the <a href="https://github.com/eclipse-cbi/p2repo-aggregator">CBI aggregator</a> to produce a Maven-compatible repository
with contents as specified by the <a href="https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/master/eclipse.platform.releng/publish-to-maven-central/SDK4Mvn.aggr">SDK4Mvn.aggr</a> and
then publishes the artifacts for <code>Eclipse-Platform</code>, <code>JDT</code>, <code>Equinox</code> and <code>PDE</code> from the output:
with contents as specified by the <a href="https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/master/eclipse.platform.releng/deploy-to-maven/SDK4Mvn.aggr">SDK4Mvn.aggr</a> and
then deploys the artifacts for <code>Eclipse-Platform</code>, <code>JDT</code>, <code>Equinox</code> and <code>PDE</code> from the output:
</p>
<ul>
<li>
Snapshots are published to <a href="https://repo.eclipse.org/content/repositories/eclipse-snapshots/">https://repo.eclipse.org/content/repositories/eclipse-snapshots/</a>.
Snapshots are deployed to <a href="https://repo.eclipse.org/content/repositories/eclipse-snapshots/">https://repo.eclipse.org/content/repositories/eclipse-snapshots/</a>.
</li>
<li>
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>.
Releases are deployed to <a href="https://repo1.maven.org/maven2/org/eclipse/">Maven central</a> by deploying to a <a href="https://oss.sonatype.org/#stagingRepositories">staging repository</a>.
</li>
</ul>
<p>
''')
parameters { // Define parameters in job configuration to make them available even for the very first build after this job was (re)created.
choiceParam('snapshotOrRelease', ['snapshot' /*default*/, 'release'], '''\
If this is the publication of a snapshot or a release build.
stringParam('sourceRepository', null, '''\
The URL of the source P2 repository to be deployed.<br>
To deploy a snapshot, 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>
<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>
If left blank (not recommended), the latest I-build is deployed.
<ul>
<li>
Snapshots are published to <a href="https://repo.eclipse.org/content/repositories/eclipse-snapshots/">https://repo.eclipse.org/content/repositories/eclipse-snapshots/</a>.
Snapshots are deployed to <a href="https://repo.eclipse.org/content/repositories/eclipse-snapshots/">https://repo.eclipse.org/content/repositories/eclipse-snapshots/</a>.
</li>
<li>
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>.
Releases are deployed to <a href="https://repo1.maven.org/maven2/org/eclipse/">Maven central</a> by deploying to a <a href="https://oss.sonatype.org/#stagingRepositories">staging repository</a>.
</li>
</ul>
''')
stringParam('sourceRepository', null, '''\
The URL of the source P2 repository to be published.<br>
<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>
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>
If left blank (not recommended), the latest I-build is published.
''')
}
definition {
Expand All @@ -45,7 +42,7 @@ If left blank (not recommended), the latest I-build is published.
scm {
github('eclipse-platform/eclipse.platform.releng.aggregator', 'master')
}
scriptPath('JenkinsJobs/Releng/publishToMaven.jenkinsfile')
scriptPath('JenkinsJobs/Releng/deployToMaven.jenkinsfile')
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pipeline {
maven 'maven-daemon'
}
environment {
DEPLOYMENT_TYPE = determineDeploymentType()
REPO = "${WORKSPACE}/repo"
CBI_AGGR = "${installLatestCbiAggr()}"
// Folder ~/.m2 is not writable for builds, ensure mvnd metadata are written within the workspace.
Expand All @@ -24,15 +25,15 @@ pipeline {
stages {
stage('Aggregate Maven repository') {
steps {
sh '''#!/bin/bash -e
FILE_SDK_AGGR="${WORKSPACE}/git-repo/eclipse.platform.releng/publish-to-maven-central/SDK4Mvn.aggr"
sh '''#!/bin/bash -xe
FILE_SDK_AGGR="${WORKSPACE}/git-repo/eclipse.platform.releng/deploy-to-maven/SDK4Mvn.aggr"

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

Expand All @@ -49,6 +50,7 @@ pipeline {

pushd ${REPO}

set +x
echo "========== Repo aggregation completed ========="

# Find all the artifact folders for all projects
Expand All @@ -69,7 +71,7 @@ pipeline {
}
}
stage('Validate repository') {
// Tests that each to-be-published artifact can transitively resolve all its dependencies.
// Tests that each to-be deployed artifact can transitively resolve all its dependencies.
steps {
dir('repo-validation') { // Do the work in a clean folder without a pom.xml
sh '''#!/bin/bash -xe
Expand All @@ -81,7 +83,7 @@ pipeline {
}
}
}
stage('Publish artifacts to Maven-Central') {
stage('Deploy artifacts') {
matrix {
axes {
axis { // environment variable is also used by called scripts!
Expand All @@ -90,7 +92,7 @@ pipeline {
}
}
stages {
stage('Publish project to Maven'){
stage('Deploy project to Maven'){
environment {
SETTINGS = "/home/jenkins/.m2/settings-deploy-ossrh-${PROJECT == 'platform' ? 'releng': PROJECT}.xml"
// The location of the temporarily file that contains the secret file content
Expand All @@ -99,7 +101,7 @@ pipeline {
MAVEN_GPG_PASSPHRASE = credentials("secret-subkeys-${PROJECT == 'platform' ? 'releng': PROJECT}.asc-passphrase")
}
steps {
dir("publish-${PROJECT}"){
dir("deploy-${PROJECT}"){
sh '''#!/bin/sh -xe
# Copy configuration pom into clean directory to stop maven from finding the .mvn folder of this git-repository
cp "${WORKSPACE}/git-repo/eclipse-platform-parent/pom.xml" eclipse-parent-pom.xml
Expand Down Expand Up @@ -179,6 +181,15 @@ pipeline {
}
}

def determineDeploymentType() {
if ("${sourceRepository}".trim() =~ /\/(?<version>\d+\.\d+)\/R-\k<version>(\.\d+)?-\d{12}(\/)?$/) {
input message: 'The specified P2 repository is a release and will be deployed to Maven-Central.', ok : 'Proceed deploying to Maven-Central'
return 'release'
} else {
return 'snapshot'
}
}

def installLatestCbiAggr(){
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'
}
Expand Down
11 changes: 5 additions & 6 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ The actual steps to release
- Change the DL_TYPE from S to R.
- TAG will be set to R as well, for example `R4_27`
- You can subscribe to [cross-project-issues](https://accounts.eclipse.org/mailing-list/cross-project-issues-dev) to get the notifications on Simrel releases.
* #### **Publish to Maven central**
- 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.
- 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`.
- Once that publish job has completed successfully, log into https://oss.sonatype.org/#stagingRepositories and close the Platform, JDT and PDE repositories.
* #### **Deploy to Maven central**
- Deploying to maven should happen by at least Tuesday before the release since there is up to a 24 hour delay for the maven mirrors.
- Run the [Deploy to Maven](https://ci.eclipse.org/releng/job/Releng/job/deployToMaven/) job in Jenkins with the release build as `sourceRepository`.
- 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.
- Once that deploy-job has completed successfully, log into https://oss.sonatype.org/#stagingRepositories and close the Platform, JDT and PDE repositories.
- 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.
* **Contribute to SimRel**
- If SimRel is not updated before the I-builds are cleaned up (specifically the build for RC2/GA) it will break.
Expand All @@ -134,8 +135,6 @@ The release is scheduled for 10AM EST. Typically the jobs are scheduled beforeha
- 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.
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.
- 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.
* **Set Maven to Publish to I-builds**
- 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.
* **Set Previous Release to GA**
- Everything that was updated to RC2 (see below) should now use the released build.

Expand Down
2 changes: 1 addition & 1 deletion RELENG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Adding a job to Jenkins should be as easy as adding a new groovy file to git, bu

* **No dashes in filenames**, it breaks JobDSL. If there was a `-` in the job name I changed it to `_` in the file name.
* **Job Names**
- No spaces, this is just for the good of scripts etc. The job NAME is used in the url, but you can always add a `displayName` field if you want the job to appear with a more natural looking name on the page. See (Releng/PublishToMaven)[JenkinsJobs/Releng/FOLDER.groovy] as an example.
- No spaces, this is just for the good of scripts etc. The job NAME is used in the url, but you can always add a `displayName` field if you want the job to appear with a more natural looking name on the page. See (Releng/deployToMaven)[JenkinsJobs/Releng/FOLDER.groovy] as an example.
- The folder needs to be part of the job name, otherwise Jenkins will just create the job at the dashboard level.
* **job vs pipelineJob**
- Anything that can build on a regular jenkins node or via an available lable uses the (job)[https://jenkinsci.github.io/job-dsl-plugin/#path/job] template.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>publish-to-maven-central</name>
<name>deploy-to-maven</name>
<comment></comment>
<projects>
</projects>
Expand Down
Loading