@@ -88,12 +88,6 @@ pipeline {
8888 '''
8989 }
9090 }
91- /*TODO: Test:
92- - If deploying the parent POM works
93- - If pushing works to aggr and submodules (e.g. pde)
94- - if creation of milestones works in aggr-repo and submodules (e.g. PDE)
95- - if PR createion works in aggr-repo and submodules (e.g. PDE)
96- */
9791 stage('Update Maven Version') {
9892 environment {
9993 MAVEN_ARGS = '-U -B -ntp'
@@ -215,8 +209,14 @@ pipeline {
215209 - Updating the previous release version to the current Release-Candidate: `${PREVIOUS_RELEASE_CANDIDATE_ID}`
216210 """.stripIndent(), prBranch)
217211
218- def submoduleURLs = sh(script: "git submodule foreach --quiet 'git config remote.origin.url'", returnStdout: true).trim().split('\\s')
219- for (submoduleURL in submoduleURLs) {
212+ def submodulePaths = sh(script: "git submodule --quiet foreach 'echo \$sm_path'", returnStdout: true).trim().split('\\s')
213+ for (submodulePath in submodulePaths) {
214+ def diff = sh(script:"cd ${submodulePath} && git diff HEAD origin/master --shortstat", returnStdout: true).trim()
215+ if (diff.isEmpty()) {
216+ echo "Skipping submodule without changes: ${submodulePath}"
217+ continue
218+ }
219+ def submoduleURL = sh(script: "cd ${submodulePath} && git config remote.origin.url", returnStdout: true).trim()
220220 // Extract repository path from e.g.: https://github.com/eclipse-platform/eclipse.platform.git
221221 def expectedPrefix = 'https://github.com/'
222222 def expectedSuffix = '.git'
@@ -242,8 +242,16 @@ pipeline {
242242 def organisations = [ 'eclipse-platform', 'eclipse-jdt', 'eclipse-pde', 'eclipse-equinox' ]
243243 for (organisation in organisations) {
244244 def repositories = listReposOfOrganization(organisation)
245- echo "${organisation} repositories: ${repositories}"
246- for (repository in repositories) {
245+ echo "${organisation} repositories: ${repositories.name}"
246+ for (repositoryData in repositories) {
247+ def repository = repositoryData.name
248+ if (repositoryData.archived) {
249+ echo "Skipping archived repository: ${repository}"
250+ continue
251+ } else if ('.eclipsefdn'.equals(repository)) {
252+ echo "Skipping .eclipsefdn repository of : ${organisation}"
253+ continue
254+ }
247255 createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} M1", "${NEXT_RELEASE_VERSION} Milestone 1", "${M1_DATE}")
248256 createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} M2", "${NEXT_RELEASE_VERSION} Milestone 2", "${M2_DATE}")
249257 createMilestone(organisation, repository, "${NEXT_RELEASE_VERSION} M3", "${NEXT_RELEASE_VERSION} Milestone 3", "${M3_DATE}")
@@ -291,7 +299,7 @@ def listReposOfOrganization(String orga) {
291299 if (!(response instanceof List) && (response.errors || (response.status && response.status != 201))) {
292300 error "Response contains errors:\n${response}"
293301 }
294- return response.name
302+ return response
295303}
296304
297305/**
@@ -310,8 +318,6 @@ def createMilestone(String orga, String repo, String msTitle, String msDescripti
310318 } else {
311319 error "Response contains errors:\n${response}"
312320 }
313- } else {
314- echo 'Created successfully'
315321 }
316322}
317323
0 commit comments