Skip to content

Commit ec6ee44

Browse files
committed
[RelEng] Merge Tag Eclipse job into promoteBuild job
The latter was the only caller of the former and merging them avoids a lot of boiler-plate code to configure the second job.
1 parent db80a08 commit ec6ee44

File tree

4 files changed

+44
-98
lines changed

4 files changed

+44
-98
lines changed

JenkinsJobs/Releng/FOLDER.groovy

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -124,31 +124,6 @@ It must match the name of the build on the build machine.
124124
}
125125
}
126126

127-
pipelineJob('Releng/tagEclipseRelease'){
128-
displayName('Tag Eclipse Release')
129-
description('Tag promoted builds.')
130-
parameters {
131-
stringParam('tag', null, '''\
132-
R is used for release builds. For example: R4_25
133-
S is used for milestones and includes the milestone version. For example: S4_25_0_RC2
134-
''')
135-
stringParam('buildID', null, 'I-build ID of the build that was promoted, for example: I20220831-1800')
136-
stringParam('annotation', null, '''\
137-
GitHub issue to track tagging the release, for example:
138-
'https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/3058' - Tag Eclipse 4.36 release
139-
''')
140-
}
141-
definition {
142-
cpsScm {
143-
lightweight(true)
144-
scm {
145-
github('eclipse-platform/eclipse.platform.releng.aggregator', 'master')
146-
}
147-
scriptPath('JenkinsJobs/Releng/tagEclipseRelease.jenkinsfile')
148-
}
149-
}
150-
}
151-
152127
pipelineJob('Releng/publishPromotedBuild'){
153128
displayName('Publish Promoted Build')
154129
description('''\

JenkinsJobs/Releng/promoteBuild.jenkinsfile

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,22 @@ pipeline {
8686
assignEnvVariable('SIGNOFF_BUG', "https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/${SIGNOFF_BUG}")
8787
}
8888
assignEnvVariable('SIGNOFF_BUG_LABEL', env.SIGNOFF_BUG.replace('https://github.com/','').replace('/issues/','#'))
89-
90-
def serviceVersionSegment = (env.CHECKPOINT || env.BUILD_SERVICE != '0') ? ('_' + env.BUILD_SERVICE) : ''
91-
assignEnvVariable('TAG', "${DL_TYPE}${BUILD_MAJOR}_${BUILD_MINOR}${serviceVersionSegment}${env.CHECKPOINT ? ('_' + env.CHECKPOINT) : ''}")
89+
}
90+
}
91+
}
92+
stage('Checkout Git') {
93+
steps {
94+
dir("${WORKSPACE}/repository") {
95+
checkout scm
96+
sh '''#!/bin/bash -xe
97+
git fetch origin tag "${REPO_ID}"
98+
git checkout "${REPO_ID}"
99+
# Check out all submodules at the specified REPO_ID
100+
git submodule update --init --recursive --depth 1
101+
102+
git config --global user.email '[email protected]'
103+
git config --global user.name 'Eclipse Releng Bot'
104+
'''
92105
}
93106
}
94107
}
@@ -137,11 +150,32 @@ pipeline {
137150
}
138151
}
139152
}
140-
build job: 'Releng/tagEclipseRelease', wait: true, propagate: true, parameters: [
141-
string(name: 'tag', value: "${TAG}"),
142-
string(name: 'buildID', value: "${DROP_ID}"),
143-
string(name: 'annotation', value: "${SIGNOFF_BUG}")
144-
]
153+
}
154+
}
155+
stage('Tag Build') {
156+
environment {
157+
TAG = "${DL_TYPE}${BUILD_MAJOR}_${BUILD_MINOR}${(CHECKPOINT || BUILD_SERVICE != '0') ? ('_' + BUILD_SERVICE) : ''}${CHECKPOINT ? ('_' + CHECKPOINT) : ''}"
158+
}
159+
steps {
160+
dir("${WORKSPACE}/repository") {
161+
sshagent(['github-bot-ssh']) {
162+
sh '''#!/bin/bash -xe
163+
function tagBuild() {
164+
pushURL=$(git config remote.origin.url)
165+
if [[ "$pushURL" == http* ]]; then
166+
# Change to SSH, if the configured URL uses HTTPS (we can only push with SSH)
167+
pushURL=$(echo $pushURL|sed --expression 's|https://github.com/|[email protected]:|')
168+
fi
169+
git tag -a -m "${SIGNOFF_BUG}" ${TAG} HEAD
170+
# git push fails if the tag already exists
171+
git push --verbose ${pushURL} tag ${TAG}
172+
}
173+
tagBuild
174+
export -f tagBuild
175+
git submodule foreach 'tagBuild'
176+
'''
177+
}
178+
}
145179
}
146180
}
147181
stage('Promote P2 Repository') {
@@ -152,19 +186,13 @@ pipeline {
152186
dir("${WORKSPACE}/updates") {
153187
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
154188
sh '''#!/bin/bash -xe
155-
git clone --depth=1 --filter=tree:0 --no-checkout --branch=master https://github.com/eclipse-platform/eclipse.platform.releng.aggregator.git
156-
pushd eclipse.platform.releng.aggregator
157-
git sparse-checkout set --no-cone eclipse-platform-parent/pom.xml
158-
git checkout
159-
popd
160-
161189
sourceRepo="eclipse/updates/${BUILD_REPO_ORIGINAL}/${REPO_ID}"
162190
targetRepo="eclipse/updates/${REPO_SITE_SEGMENT}/${DL_DROP_ID}"
163191
ssh [email protected] cp -r "${EP_ROOT}/${sourceRepo}/." "${EP_ROOT}/${targetRepo}"
164192

165193
MIRRORS_URL="https://www.eclipse.org/downloads/download.php?file=/${targetRepo}"
166194
mvn tycho-p2-repository:modify-repository-properties -Pp2-repository-modification \\
167-
--file eclipse.platform.releng.aggregator/eclipse-platform-parent/ \\
195+
--file ${WORKSPACE}/repository/eclipse-platform-parent/pom.xml \\
168196
-Dp2.repository.location=https://download.eclipse.org/${sourceRepo}/ \\
169197
-Dp2.repository.output=$(pwd)/output \\
170198
-Dp2.repository.kind=artifact \\
@@ -179,7 +207,7 @@ pipeline {
179207
}
180208
post {
181209
always {
182-
archiveArtifacts '**/*'
210+
archiveArtifacts artifacts: '**/*', excludes: 'repository/**'
183211
}
184212
}
185213
}

JenkinsJobs/Releng/tagEclipseRelease.jenkinsfile

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

RELEASE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
- SIGNOFF_BUG: Needs to be updated to sign-off issue (numeric part only)
4242
- TRAIN_NAME: Whenever the current GA release is planned for (formatted 4 digit year - 2 digit month, i.e `2022-06`)
4343
- After the build find and open the mail template [artifact](https://ci.eclipse.org/releng/job/Releng/job/promoteBuild/lastSuccessfulBuild/artifact/) and have it ready.
44-
- This should automatically run [tag Eclipse release](https://ci.eclipse.org/releng/job/Releng/job/tagEclipseRelease/) to tag the source code.
4544
* Contribute to SimRel
4645
- If you have not already set up SimRel you can do so using Auto Launch [here](https://www.eclipse.org/setups/installer/?url=https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/interim/SimultaneousReleaseTrainConfiguration.setup&show=true)
4746
- Clone [org.eclipse.simrel.build](https://git.eclipse.org/c/simrel/org.eclipse.simrel.build.git) (Should have been done by the installer during set up, but make sure you have latest).

0 commit comments

Comments
 (0)