diff --git a/JenkinsJobs/Releng/FOLDER.groovy b/JenkinsJobs/Releng/FOLDER.groovy index c561214a10f..23968939991 100644 --- a/JenkinsJobs/Releng/FOLDER.groovy +++ b/JenkinsJobs/Releng/FOLDER.groovy @@ -124,31 +124,6 @@ It must match the name of the build on the build machine. } } -pipelineJob('Releng/tagEclipseRelease'){ - displayName('Tag Eclipse Release') - description('Tag promoted builds.') - parameters { - stringParam('tag', null, '''\ -R is used for release builds. For example: R4_25 -S is used for milestones and includes the milestone version. For example: S4_25_0_RC2 -''') - stringParam('buildID', null, 'I-build ID of the build that was promoted, for example: I20220831-1800') - stringParam('annotation', null, '''\ -GitHub issue to track tagging the release, for example: -'https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/3058' - Tag Eclipse 4.36 release -''') - } - definition { - cpsScm { - lightweight(true) - scm { - github('eclipse-platform/eclipse.platform.releng.aggregator', 'master') - } - scriptPath('JenkinsJobs/Releng/tagEclipseRelease.jenkinsfile') - } - } -} - pipelineJob('Releng/publishPromotedBuild'){ displayName('Publish Promoted Build') description('''\ diff --git a/JenkinsJobs/Releng/promoteBuild.jenkinsfile b/JenkinsJobs/Releng/promoteBuild.jenkinsfile index 28f11d81195..96798a39f31 100644 --- a/JenkinsJobs/Releng/promoteBuild.jenkinsfile +++ b/JenkinsJobs/Releng/promoteBuild.jenkinsfile @@ -86,9 +86,22 @@ pipeline { assignEnvVariable('SIGNOFF_BUG', "https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/${SIGNOFF_BUG}") } assignEnvVariable('SIGNOFF_BUG_LABEL', env.SIGNOFF_BUG.replace('https://github.com/','').replace('/issues/','#')) - - def serviceVersionSegment = (env.CHECKPOINT || env.BUILD_SERVICE != '0') ? ('_' + env.BUILD_SERVICE) : '' - assignEnvVariable('TAG', "${DL_TYPE}${BUILD_MAJOR}_${BUILD_MINOR}${serviceVersionSegment}${env.CHECKPOINT ? ('_' + env.CHECKPOINT) : ''}") + } + } + } + stage('Checkout Git') { + steps { + dir("${WORKSPACE}/repository") { + checkout scm + sh '''#!/bin/bash -xe + git fetch origin tag "${REPO_ID}" + git checkout "${REPO_ID}" + # Check out all submodules at the specified REPO_ID + git submodule update --init --recursive --depth 1 + + git config --global user.email 'releng-bot@eclipse.org' + git config --global user.name 'Eclipse Releng Bot' + ''' } } } @@ -137,11 +150,32 @@ pipeline { } } } - build job: 'Releng/tagEclipseRelease', wait: true, propagate: true, parameters: [ - string(name: 'tag', value: "${TAG}"), - string(name: 'buildID', value: "${DROP_ID}"), - string(name: 'annotation', value: "${SIGNOFF_BUG}") - ] + } + } + stage('Tag Build') { + environment { + TAG = "${DL_TYPE}${BUILD_MAJOR}_${BUILD_MINOR}${(CHECKPOINT || BUILD_SERVICE != '0') ? ('_' + BUILD_SERVICE) : ''}${CHECKPOINT ? ('_' + CHECKPOINT) : ''}" + } + steps { + dir("${WORKSPACE}/repository") { + sshagent(['github-bot-ssh']) { + sh '''#!/bin/bash -xe + function tagBuild() { + pushURL=$(git config remote.origin.url) + if [[ "$pushURL" == http* ]]; then + # Change to SSH, if the configured URL uses HTTPS (we can only push with SSH) + pushURL=$(echo $pushURL|sed --expression 's|https://github.com/|git@github.com:|') + fi + git tag -a -m "${SIGNOFF_BUG}" ${TAG} HEAD + # git push fails if the tag already exists + git push --verbose ${pushURL} tag ${TAG} + } + tagBuild + export -f tagBuild + git submodule foreach 'tagBuild' + ''' + } + } } } stage('Promote P2 Repository') { @@ -152,19 +186,13 @@ pipeline { dir("${WORKSPACE}/updates") { sshagent(['projects-storage.eclipse.org-bot-ssh']) { sh '''#!/bin/bash -xe - git clone --depth=1 --filter=tree:0 --no-checkout --branch=master https://github.com/eclipse-platform/eclipse.platform.releng.aggregator.git - pushd eclipse.platform.releng.aggregator - git sparse-checkout set --no-cone eclipse-platform-parent/pom.xml - git checkout - popd - sourceRepo="eclipse/updates/${BUILD_REPO_ORIGINAL}/${REPO_ID}" targetRepo="eclipse/updates/${REPO_SITE_SEGMENT}/${DL_DROP_ID}" ssh genie.releng@projects-storage.eclipse.org cp -r "${EP_ROOT}/${sourceRepo}/." "${EP_ROOT}/${targetRepo}" MIRRORS_URL="https://www.eclipse.org/downloads/download.php?file=/${targetRepo}" mvn tycho-p2-repository:modify-repository-properties -Pp2-repository-modification \\ - --file eclipse.platform.releng.aggregator/eclipse-platform-parent/ \\ + --file ${WORKSPACE}/repository/eclipse-platform-parent/pom.xml \\ -Dp2.repository.location=https://download.eclipse.org/${sourceRepo}/ \\ -Dp2.repository.output=$(pwd)/output \\ -Dp2.repository.kind=artifact \\ @@ -179,7 +207,7 @@ pipeline { } post { always { - archiveArtifacts '**/*' + archiveArtifacts artifacts: '**/*', excludes: 'repository/**' } } } diff --git a/JenkinsJobs/Releng/tagEclipseRelease.jenkinsfile b/JenkinsJobs/Releng/tagEclipseRelease.jenkinsfile deleted file mode 100644 index 489a9383040..00000000000 --- a/JenkinsJobs/Releng/tagEclipseRelease.jenkinsfile +++ /dev/null @@ -1,56 +0,0 @@ -pipeline { - options { - timestamps() - timeout(time: 15, unit: 'MINUTES') - buildDiscarder(logRotator(numToKeepStr:'5')) - } - agent { - label 'basic' - } - stages { - stage('Checkout Submodules') { - steps { - sh ''' - git fetch origin tag "${buildID}" - git checkout "${buildID}" - # Check out all submodules at the specified buildID - git submodule update --init --recursive --depth 1 - - git config --global user.email 'releng-bot@eclipse.org' - git config --global user.name 'Eclipse Releng Bot' - ''' - } - } - stage('Tag build') { - steps { - sshagent(['github-bot-ssh']) { - sh '''#!/bin/bash -xe - # Strip spaces from the buildID and tag - buildID=$(echo $buildID|tr -d ' ') - tag=$(echo $tag|tr -d ' ') - - #If build id or tag is empty we need to exit. - if [ -z "$buildID" ] || [ -z "$tag" ]; then - echo 'buildID or tag input is not specified' - exit 1 - fi - - function tagBuild() { - pushURL=$(git config remote.origin.url) - if [[ "$pushURL" == http* ]]; then - # Change to SSH, if the configured URL uses HTTPS (we can only push with SSH) - pushURL=$(echo $pushURL|sed --expression 's|https://github.com/|git@github.com:|') - fi - git tag -a -m "${annotation}" ${tag} HEAD - # git push fails if the tag already exists - git push --verbose ${pushURL} tag ${tag} - } - tagBuild - export -f tagBuild - git submodule foreach 'tagBuild' - ''' - } - } - } - } -} diff --git a/RELEASE.md b/RELEASE.md index dbbbde23fff..f47a89b7ac5 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -41,7 +41,6 @@ - SIGNOFF_BUG: Needs to be updated to sign-off issue (numeric part only) - TRAIN_NAME: Whenever the current GA release is planned for (formatted 4 digit year - 2 digit month, i.e `2022-06`) - 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. - - This should automatically run [tag Eclipse release](https://ci.eclipse.org/releng/job/Releng/job/tagEclipseRelease/) to tag the source code. * Contribute to SimRel - 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) - 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).