@@ -159,6 +159,42 @@ pipeline {
159159 commitAllChangesExcludingSubmodules("Move previous version to ${PREVIOUS_RELEASE_CANDIDATE_TAG} in build scripts")
160160 }
161161 }
162+ stage ('Create New Stream Repos') {
163+ environment {
164+ ECLIPSE_EXE = installEclipsePlatformProduct("${PREVIOUS_RELEASE_CANDIDATE_ID}", "${PREVIOUS_RELEASE_CANDIDATE_TAG}")
165+ }
166+ steps {
167+ dir("${WORKSPACE}/target/repositories") {
168+ sshagent(['projects-storage.eclipse.org-bot-ssh']) {
169+ sh '''#!/bin/bash -xe
170+ epUpdatesDir='/home/data/httpd/download.eclipse.org/eclipse/updates'
171+ templateRepo="${epUpdatesDir}/template_repo"
172+
173+ releaseRepoName="${NEXT_RELEASE_VERSION}"
174+ iBuildRepoName="${NEXT_RELEASE_VERSION}-I-builds"
175+ yBuildRepoName="${NEXT_RELEASE_VERSION}-Y-builds"
176+ previousRCRepo="https://download.eclipse.org/eclipse/updates/${PREVIOUS_RELEASE_VERSION}-I-builds/${PREVIOUS_RELEASE_CANDIDATE_I_BUILD}/"
177+
178+ # Copy the repo-template to this workspace to create the new I-build repo from it,
179+ # then add the previous release RC as only child and copy the resulting repo back to the download-server
180+ curl -o addToComposite.xml https://download.eclipse.org/eclipse/relengScripts/cje-production/scripts/addToComposite.xml
181+ scp -r
[email protected] :${templateRepo} template_repo/
182+ cp -r template_repo ${iBuildRepoName}
183+
184+ taskName='addToComposite'
185+ ${ECLIPSE_EXE} -nosplash -consolelog -debug -data ./eclipse-ws \
186+ -application org.eclipse.ant.core.antRunner -file ${taskName}.xml \
187+ ${taskName} -Drepodir=$(pwd)/${iBuildRepoName} -Dcomplocation=${previousRCRepo}
188+ if [[ ${DRY_RUN} == 'false' ]]; then
189+ scp -r ${iBuildRepoName}
[email protected] :${epUpdatesDir}/${iBuildRepoName}
190+ ssh
[email protected] cp -r ${templateRepo} ${epUpdatesDir}/${yBuildRepoName}
191+ ssh
[email protected] cp -r ${templateRepo} ${epUpdatesDir}/${releaseRepoName}
192+ fi
193+ '''
194+ }
195+ }
196+ }
197+ }
162198 stage('Deploy parent-pom and SDK-target') {
163199 // Deploy new parent first to ensure it's available when PRs for submodule updates are created.
164200 environment {
@@ -174,7 +210,7 @@ pipeline {
174210 stage('Push preparation branches') {
175211 steps {
176212 sshagent (['github-bot-ssh']) {
177- sh '''
213+ sh '''#!/bin/bash -x
178214 function pushNewCommitsToPreparationBranch() {
179215 pushURL=$(git config remote.origin.url)
180216 # Switch to SSH, if the configured URL uses HTTPS (we can only push with SSH)
@@ -264,8 +300,17 @@ pipeline {
264300 }
265301 }
266302 }
303+ post {
304+ always {
305+ archiveArtifacts allowEmptyArchive: true, artifacts: '\
306+ target/repositories/**,\
307+ '
308+ }
309+ }
267310}
268311
312+ // --- utility methods
313+
269314@NonCPS
270315def parseDate(String dateString) {
271316 return java.time.LocalDate.parse(dateString.trim()) // expects format 'yyyy-MM-dd'
@@ -294,6 +339,22 @@ def commitAllChangesExcludingSubmodules(String commitMessage) {
294339 }
295340}
296341
342+ // build tools
343+
344+ def installEclipsePlatformProduct(String releaseID, String releaseVersion){
345+ def eclipseURL = "https://download.eclipse.org/eclipse/downloads/drops4/${releaseID}/eclipse-platform-${releaseVersion}-linux-gtk-x86_64.tar.gz"
346+ return install('eclipse-platform', eclipseURL) + '/eclipse'
347+ }
348+
349+ def install(String toolType, String url) {
350+ dir("${WORKSPACE}/target/tools/${toolType}") {
351+ sh "curl -L ${url} | tar -xzf -"
352+ return "${pwd()}/" + sh(script: 'ls', returnStdout: true).trim()
353+ }
354+ }
355+
356+ // Github API interactions
357+
297358def listReposOfOrganization(String orga) {
298359 def response = queryGithubAPI('', "orgs/${orga}/repos", null)
299360 if (!(response instanceof List) && (response.errors || (response.status && response.status != 201))) {
0 commit comments