@@ -159,6 +159,45 @@ 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+ //TODO: check variable access style!
165+ ECLIPSE = installEclipsePlatformProduct("${PREVIOUS_RELEASE_CANDIDATE_ID}", "${PREVIOUS_RELEASE_CANDIDATE_TAG}")
166+ }
167+ steps {
168+ dir("${WORKSPACE}/target/repositories") {
169+ sshagent(['projects-storage.eclipse.org-bot-ssh']) {
170+ //TODO: check and unify shebang!
171+ sh '''#!/bin/bash -x -e
172+ #TODO: clean up. Check commented out things
173+ epUpdatesDir='/home/data/httpd/download.eclipse.org/eclipse/updates'
174+ templateRepo="${epUpdatesDir}/template_repo/"
175+
176+ releaseRepoName="${NEXT_RELEASE_VERSION}/"
177+ iBuildRepoName="${NEXT_RELEASE_VERSION}-I-builds/"
178+ yBuildRepoName="${NEXT_RELEASE_VERSION}-Y-builds/"
179+ previousRCRepo="https://download.eclipse.org/eclipse/updates/${PREVIOUS_RELEASE_VERSION}-I-builds/${PREVIOUS_RELEASE_CANDIDATE_I_BUILD}/"
180+
181+ # Copy the template to this workspace to create the new I-build repo from it,
182+ #add the previous release RC as only child and copy the resulting repo to the server
183+ curl -o addToComposite.xml https://download.eclipse.org/eclipse/relengScripts/cje-production/scripts/addToComposite.xml
184+ scp -r
[email protected] :${templateRepo} template_repo/
185+ cp -r template_repo ${iBuildRepoName}
186+
187+ markingScriptName='addToComposite'
188+ ${ECLIPSE} -nosplash -consolelog -debug -data ./eclipse-ws \
189+ -application org.eclipse.ant.core.antRunner -file ${markingScriptName}.xml \
190+ ${markingScriptName} -Drepodir=$(pwd)/${iBuildRepoName} -Dcomplocation=${previousRCRepo}
191+ if [[ ${DRY_RUN} == 'false' ]]; then
192+ scp ${iBuildRepoName}
[email protected] :${epUpdatesDir}/${iBuildRepoName}
193+ ssh
[email protected] cp -r ${templateRepo} ${epUpdatesDir}/${releaseRepoName}
194+ ssh
[email protected] cp -r ${templateRepo} ${epUpdatesDir}/${yBuildRepoName}
195+ fi
196+ '''
197+ }
198+ }
199+ }
200+ }
162201 stage('Deploy parent-pom and SDK-target') {
163202 // Deploy new parent first to ensure it's available when PRs for submodule updates are created.
164203 environment {
@@ -174,7 +213,7 @@ pipeline {
174213 stage('Push preparation branches') {
175214 steps {
176215 sshagent (['github-bot-ssh']) {
177- sh '''
216+ sh '''#!/bin/bash -x
178217 function pushNewCommitsToPreparationBranch() {
179218 pushURL=$(git config remote.origin.url)
180219 # Switch to SSH, if the configured URL uses HTTPS (we can only push with SSH)
@@ -264,8 +303,16 @@ pipeline {
264303 }
265304 }
266305 }
306+ post {
307+ always {
308+ archiveArtifacts allowEmptyArchive: true, artifacts: '\
309+ /target/repositories/**'
310+ }
311+ }
267312}
268313
314+ // --- utility methods
315+
269316@NonCPS
270317def parseDate(String dateString) {
271318 return java.time.LocalDate.parse(dateString.trim()) // expects format 'yyyy-MM-dd'
@@ -294,6 +341,22 @@ def commitAllChangesExcludingSubmodules(String commitMessage) {
294341 }
295342}
296343
344+ // build tools
345+
346+ def installEclipsePlatformProduct(String releaseID, String releaseVersion){
347+ def eclipseURL = "https://download.eclipse.org/eclipse/downloads/drops4/${releaseID}/eclipse-platform-${releaseVersion}-linux-gtk-x86_64.tar.gz"
348+ return install('eclipse-platform', eclipseURL) + '/eclipse'
349+ }
350+
351+ def install(String toolType, String url) {
352+ dir("${WORKSPACE}/target/tools/${toolType}") {
353+ sh "curl -L ${url} | tar -xzf -"
354+ return "${pwd()}/" + sh(script: 'ls', returnStdout: true).trim()
355+ }
356+ }
357+
358+ // Github API interactions
359+
297360def listReposOfOrganization(String orga) {
298361 def response = queryGithubAPI('', "orgs/${orga}/repos", null)
299362 if (!(response instanceof List) && (response.errors || (response.status && response.status != 201))) {
0 commit comments