Skip to content
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
a8eede8
chore(QTDI-3900): Release job parameter to choose classic or SR release
lxia-talend Nov 30, 2026
be8cf41
chore(QTDI-3900): Allow SR only on an October maintenance branch
lxia-talend Dec 1, 2026
c57ea41
chore(QTDI-3900): Accept any major version in the October SR branch c…
lxia-talend Dec 1, 2026
a457595
chore(QTDI-3900): Merge master into the SR release branch
lxia-talend Dec 1, 2026
16da13a
chore(QTDI-3900): Use the connectors-lib shared library only (drop tq…
lxia-talend Dec 1, 2026
26a9e9d
chore(QTDI-3900): Replace JenkinsPodConfig by PodController (connecto…
lxia-talend Dec 1, 2026
896ad35
chore(QTDI-3900): Report an invalid SR_NUMBER as one readable error line
lxia-talend Dec 1, 2026
9b6a572
chore(QTDI-3900): SR means Support Release
lxia-talend Dec 1, 2026
20879bc
Change library reference to stable version 2.0.3
lxia-talend Dec 2, 2026
5ab5811
chore(QTDI-3900): Check the SR number against the SR releases of the …
lxia-talend Dec 2, 2026
00e3d49
chore(QTDI-3900): Pin the library branch with the SR number checks (t…
lxia-talend Dec 2, 2026
8ad7748
chore(QTDI-3900): Call VersionController.checkSrRelease instead of a …
lxia-talend Dec 2, 2026
e8fd770
chore(QTDI-3900): Show the parameter descriptions on several lines (m…
lxia-talend Dec 2, 2026
ba8c5e8
chore(QTDI-3900): Do not fail the post action when the previous build…
lxia-talend Dec 2, 2026
305591c
chore(QTDI-3900): Do not send the Slack notification for a DRY_RUN
lxia-talend Dec 2, 2026
715a36a
chore(QTDI-3900): Use an isSrRelease() function instead of a global v…
lxia-talend Dec 3, 2026
6c40deb
chore(QTDI-3900): Use connectors-lib 2.0.4
lxia-talend Dec 3, 2026
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
153 changes: 113 additions & 40 deletions ci/Jenkinsfile-release
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ final String branchName = env.BRANCH_NAME
final Boolean isMasterBranch = branchName == 'master'
final Boolean isMaintenanceBranch = branchName.startsWith('maintenance/')
final Boolean isMaintenanceRelease = false
String srNotes = '' // Checks of the SR number against the SR releases of the branch (SR only)
final String extraBuildParams = ""

// Job variables declaration
Expand All @@ -59,8 +60,7 @@ String maintenanceBranch // created maintenance branch name

pipeline {
libraries {
lib("connectors-lib@1.2.0") // https://github.com/Talend/tdi-jenkins-shared-libraries
lib("tqa-e2e-tests-tool@v2.4.2-ttp2") // https://github.com/Talend/tqa-e2e-testing-tool
lib("connectors-lib@2.0.4") // https://github.com/Talend/tdi-jenkins-shared-libraries
}

agent {
Expand Down Expand Up @@ -106,6 +106,30 @@ pipeline {
can only execute a MAINTENANCE release action" style error if run elsewhere, e.g. on master).
ex: 1.2610.1-SNAPSHOT is released as 1.2610.1 and the maintenance branch is bumped as 1.2610.2-SNAPSHOT''')

choice(
name: 'RELEASE_TYPE',
choices: ['CLASSIC', 'SR'],
description: '''
Kind of MAINTENANCE release (LTS versioning rules). Only used with ACTION=MAINTENANCE.
CLASSIC: classic maintenance release (default, unchanged behavior).
ex: 1.2610.2-SNAPSHOT is released as 1.2610.2 (tag component-runtime-1.2610.2)
SR: Support Release. SR_NUMBER is REQUIRED, ACTION must be MAINTENANCE and the branch must be
an October maintenance branch (maintenance/<major>.YY10, e.g. maintenance/1.2610):
the job fails fast otherwise.
ex: 1.2610.2-SNAPSHOT with SR_NUMBER=1 is released as 1.2610.2-SR01 (tag component-runtime-1.2610.2-SR01)
and the maintenance branch is bumped as 1.2610.3-SNAPSHOT''')

string(
name: 'SR_NUMBER',
defaultValue: '',
description: '''
Number of the Support Release, 1 or 2 digits (1 or 01 for SR01).
REQUIRED when RELEASE_TYPE=SR, ignored for CLASSIC.
It must match the number of the Studio Support Release (SR01, SR02, ...).
The job checks it against the SR releases already published on the branch:
- the release already exists, or the number is lower than the latest SR: the job fails fast;
- the number is higher than the latest SR + 1: a WARNING in the confirmation prompt.''')


///////////////////////////////////////////////////////////////////////////////////////////////////////////////
separator(name: "VERSION_CONFIG", sectionHeader: "Version configuration",
Expand Down Expand Up @@ -159,29 +183,30 @@ pipeline {
booleanParam(
name: 'DRY_RUN',
defaultValue: false,
description: '''OBJECTIVE: validate the computed release/next versions and the pipeline logic itself,
without publishing anything anywhere.
CONSEQUENCES:
- `release:prepare` runs with `-DdryRun=true`: poms are rewritten and validated locally only.
- Nothing is committed, tagged or pushed to git (real repo or fork).
- The perform stage is skipped (it needs a real, tagged
`release:prepare` output to run against).
- The docker, next iteration and maintenance branch stages still run, but in mock
mode: the docker image is only built to a local tar (never pushed), and every
git push is simulated with `git push --dry-run` (no ref is actually updated).
- Nothing is deployed/published to any repository.
Use this first, before a real release, to sanity-check the versions and the job.''')
description: '''
OBJECTIVE: validate the computed release/next versions and the pipeline logic itself,
without publishing anything anywhere.
CONSEQUENCES:
- `release:prepare` runs with `-DdryRun=true`: poms are rewritten and validated locally only.
- Nothing is committed, tagged or pushed to git (real repo or fork).
- The perform stage is skipped (it needs a real, tagged `release:prepare` output to run against).
- The docker, next iteration and maintenance branch stages still run, but in mock
mode: the docker image is only built to a local tar (never pushed), and every
git push is simulated with `git push --dry-run` (no ref is actually updated).
- Nothing is deployed/published to any repository.
Use this first, before a real release, to sanity-check the versions and the job.''')
booleanParam(
name: 'FAKE_RELEASE',
defaultValue: false,
description: '''OBJECTIVE: debug the real release mechanics (git tag/commit/push, perform, docker, etc.)
end-to-end, without touching the real talend/component-runtime repository.
CONSEQUENCES:
- This IS a real release: it commits, tags and pushes, and can deploy/publish artifacts.
- The git target is redirected to the fork given by FAKE_REPOSITORY instead of
talend/component-runtime.
Note: if you only want to simulate a release and publish nothing, use DRY_RUN instead —
DRY_RUN and FAKE_RELEASE address different needs and are not interchangeable.''')
description: '''
OBJECTIVE: debug the real release mechanics (git tag/commit/push, perform, docker, etc.)
end-to-end, without touching the real talend/component-runtime repository.
CONSEQUENCES:
- This IS a real release: it commits, tags and pushes, and can deploy/publish artifacts.
- The git target is redirected to the fork given by FAKE_REPOSITORY instead of
talend/component-runtime.
Note: if you only want to simulate a release and publish nothing, use DRY_RUN instead:
DRY_RUN and FAKE_RELEASE address different needs and are not interchangeable.''')
string(
name: 'FAKE_REPOSITORY',
defaultValue: 'acatoire/component-runtime',
Expand Down Expand Up @@ -217,10 +242,9 @@ pipeline {
// asdf install
///////////////////////////////////////////
script {
String javaVersion = JenkinsPodConfig.asdfSetVersion("$env.WORKSPACE/.tool-versions", 'java', params.JAVA_VERSION)
String mavenVersion = JenkinsPodConfig.asdfSetVersion("$env.WORKSPACE/.tool-versions", 'maven', params.MAVEN_VERSION)
JenkinsStatusController.jobDescriptionAppend("Use java $javaVersion with maven $mavenVersion ")
JenkinsPodConfig.asdfInstall()
Map<String, String> requestedVersions = ["java": params.JAVA_VERSION, "maven": params.MAVEN_VERSION] as Map<String, String>
Map<String, String> installedVersions = PodController.asdfInstall('.tool-versions', requestedVersions)
JenkinsStatusController.jobDescriptionAppend("Used version: $installedVersions")
}

///////////////////////////////////////////
Expand All @@ -237,11 +261,12 @@ pipeline {
// Updating build displayName and description
///////////////////////////////////////////
script {
JenkinsStatusController.jobNameCreation(params.DRY_RUN ? "$params.ACTION-DRY_RUN" : "$params.ACTION")
String releaseKind = isSrRelease() ? "${params.ACTION}-SR" : "$params.ACTION"
JenkinsStatusController.jobNameCreation(params.DRY_RUN ? "$releaseKind-DRY_RUN" : "$releaseKind")

// updating build description
String description = """
Execute a $params.ACTION release.
Execute a $releaseKind release.
Debug: $params.JENKINS_DEBUG
Extra build args: $extraBuildParams
""".stripIndent()
Expand Down Expand Up @@ -297,6 +322,16 @@ pipeline {
// ACTION check
///////////////////////////////////////////
script {
// A Support Release is a maintenance release, whatever the branch it is started from.
if (isSrRelease() && params.ACTION != 'MAINTENANCE') {
error("RELEASE_TYPE=SR is only allowed with ACTION=MAINTENANCE (got ACTION=${params.ACTION})")
}
// An SR line opens every October (maintenance/<major>.YY10, ex: maintenance/1.2610, maintenance/1.2710):
// the other months only get classic maintenance releases.
if (isSrRelease() && !(branchName ==~ /^maintenance\/\d+\.\d{2}10$/)) {
error("RELEASE_TYPE=SR is only allowed on an October maintenance branch (maintenance/<major>.YY10, ex: maintenance/1.2610), got branch ${branchName}")
}

// Check on maintenance branch
if (isMaintenanceBranch) {
if (params.ACTION == 'MAINTENANCE') {
Expand Down Expand Up @@ -335,13 +370,20 @@ pipeline {
echo 'Manage the release version '
(releaseVersion, nextVersion,
maintenanceVersion, maintenanceBranch) = get_release_info(pomVersion,
isMaintenanceRelease)
isMaintenanceRelease,
isSrRelease(),
params.SR_NUMBER as String)
tagName = "component-runtime-${releaseVersion}"

if (isSrRelease()) {
srNotes = VersionController.checkSrRelease(branchName, releaseVersion, 'component-runtime-')
}

// Written under target/ so it stays out of the SCM working tree inspected by release:prepare
writeFile file: 'target/release-version-info.txt',
text: """\
pomVersion=$pomVersion
releaseType=${isSrRelease() ? 'SR' : 'CLASSIC'}
releaseVersion=$releaseVersion
nextVersion=$nextVersion
maintenanceVersion=$maintenanceVersion
Expand All @@ -364,22 +406,31 @@ pipeline {

String description = """
----------------------------------------------------------------
Release type: ${isSrRelease() ? 'SR (Support Release)' : 'CLASSIC'}
Actual Version $pomVersion will be release as $releaseVersion.
After the release the repository will be bumped as $nextVersion.
----------------------------------------------------------------

""".stripIndent()
JenkinsStatusController.jobDescriptionAppend(description)
if (srNotes) {
for (String note : srNotes.split('\n')) {
JenkinsStatusController.jobDescriptionAppend(note)
}
}

///////////////////////////////////////////
// Manual validation of release action
///////////////////////////////////////////

String checkMsg = """
You will do a $params.ACTION release${params.DRY_RUN ? ' as a **DRY RUN** (nothing published)' : ''}
You will do a $params.ACTION ${isSrRelease() ? 'SR ' : ''}release${params.DRY_RUN ? ' as a **DRY RUN** (nothing published)' : ''}
Actual Version $pomVersion will be release as $releaseVersion.
After the release the repository will be bumped as $nextVersion.
**Are you OK to continue?**""".stripIndent()
After the release the repository will be bumped as $nextVersion. """.stripIndent()
if (srNotes) {
checkMsg += "\n" + srNotes.replace('\n', ' \n')
}
checkMsg += "\n**Are you OK to continue?**"

// Request user action
input message: "$checkMsg", ok: 'Yes'
Expand Down Expand Up @@ -502,13 +553,15 @@ pipeline {
post {
always {
script {
alertingTools.slack_result(
env.SLACK_CI_CHANNEL,
currentBuild.result,
currentBuild.previousBuild.result,
true, // Post for success and failure for release scripts
true,
"Failure of $pomVersion $params.ACTION release.")
if (!params.DRY_RUN) { // Only send Slack notification for real release, not for dry run
AlertingController.sendResultOnSlack(
env.SLACK_CI_CHANNEL,
currentBuild.result,
currentBuild.previousBuild?.result,
true, // Post for success and failure for release scripts
true,
"Failure of $pomVersion $params.ACTION release.")
}
}
script {
if (params.JENKINS_DEBUG) {
Expand Down Expand Up @@ -558,6 +611,14 @@ private String assemblyExtraBuildParams(Boolean fakeRelease, Boolean noStaging,
}


/**
* Whether the release is a Support Release (RELEASE_TYPE=SR): released as <x.y.z>-SRnn.
* A function of the job parameters, so there is no state to keep in sync between the stages.
*/
private boolean isSrRelease() {
return params.RELEASE_TYPE == 'SR'
}

/**
* Retrieves release information based on the provided current version.
*
Expand All @@ -575,7 +636,9 @@ private String assemblyExtraBuildParams(Boolean fakeRelease, Boolean noStaging,
* - Index 3: Maintenance branch name.
*/
private ArrayList<String> get_release_info(String currentVersion,
Boolean maintenance) {
Boolean maintenance,
Boolean sr = false,
String srNumber = '') {

println("Evaluate release name from current version: $currentVersion")
if (maintenance) {
Expand All @@ -586,6 +649,16 @@ private ArrayList<String> get_release_info(String currentVersion,
}

String releaseVersion = currentVersion.replace('-SNAPSHOT', '')
if (sr) {
// 1.2610.2-SNAPSHOT is released as 1.2610.2-SR01. Fails on a missing or invalid SR number.
try {
releaseVersion = VersionController.getSrReleaseVersion(currentVersion, srNumber)
} catch (IllegalArgumentException e) {
// One readable line instead of a stack trace.
error("RELEASE_TYPE=SR: ${e.message}")
}
println("This is a Support Release (SR)")
}
println("Release version : $releaseVersion")

Map<String, String> snapshotVersions = VersionController.getSnapshotVersion(releaseVersion)
Expand Down
Loading