You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2019/01/29 21:49:44 UTC

[sling-tooling-jenkins] branch master updated: Revert "SLING-7245 - Validate pull requests using Jenkins"

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-tooling-jenkins.git


The following commit(s) were added to refs/heads/master by this push:
     new 3d72127  Revert "SLING-7245 - Validate pull requests using Jenkins"
3d72127 is described below

commit 3d721270725789b4a2e42d17e2f32733e6d037e3
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Dec 20 16:46:05 2018 +0100

    Revert "SLING-7245 - Validate pull requests using Jenkins"
    
    No longer manually create pipeline jobs.
---
 create_jobs.groovy | 185 +++++++++++++++++++++++------------------------------
 1 file changed, 80 insertions(+), 105 deletions(-)

diff --git a/create_jobs.groovy b/create_jobs.groovy
index 9cae1ab..b69471e 100644
--- a/create_jobs.groovy
+++ b/create_jobs.groovy
@@ -26,7 +26,8 @@ manifest.project.each { project ->
     def connection = new URL(rawUrlPrefix + "/" + jobName + "/master/Jenkinsfile").openConnection()
     module.pipeline = connection.responseCode == 200
     if ( module.pipeline ) {
-        println "${jobName}: Jenkinsfile found, creating pipeline job"
+        println "${jobName}: Jenkinsfile found, skipping as they are now managed by a Github org folder."
+        createJob = false
     }
 
     if ( slingMod?.jenkins?.jdks ) {
@@ -97,137 +98,111 @@ def jdkMapping = [
 
 modules.each { module ->
 
-    if ( module.pipeline ) {
-        multibranchPipelineJob(module.location) {
-            description('''
-    <p>This build was automatically generated and any manual edits will be lost.</p>
-    <p>See <a href="https://cwiki.apache.org/confluence/display/SLING/Sling+Jenkins+Setup">Sling Jenkins Setup</a>
-    for more details</p>''')
-            branchSources {
-                github {
-                    scanCredentialsId('sling-github-token') // needs repo:status scope
-                    repoOwner('apache')
-                    repository(module.location)
-                }
-            }
+    def jdks = module.jdks ?: defaultJdks
+    def deploy = true
 
-            orphanedItemStrategy {
-                discardOldItems {
-                    numToKeep(15)
-                }
-            }
+    def downstreamProjects = module.downstream?: []
+    def downstreamEntries = modules.findAll { downstreamProjects.contains(it.location) }
+    def downstreamJobs = []
 
-            triggers {
-                periodic(1)
-            }            
-        }
-    } else {
-        def jdks = module.jdks ?: defaultJdks
-        def deploy = true
-
-        def downstreamProjects = module.downstream?: []
-        def downstreamEntries = modules.findAll { downstreamProjects.contains(it.location) }
-        def downstreamJobs = []
-
-        downstreamEntries.each { downstreamEntry ->
-            def downstreamJdks = downstreamEntry.jdks?: defaultJdks
-            def downstreamLocation = downstreamEntry.location
-            downstreamJdks.each { downstreamJdk ->
-                downstreamJobs.add(jobName(downstreamLocation,downstreamJdk))
-            }
+    downstreamEntries.each { downstreamEntry ->
+        def downstreamJdks = downstreamEntry.jdks?: defaultJdks
+        def downstreamLocation = downstreamEntry.location
+        downstreamJdks.each { downstreamJdk ->
+            downstreamJobs.add(jobName(downstreamLocation,downstreamJdk))
         }
+    }
 
-        jdks.each { jdkKey ->
-            mavenJob(jobName(module.location, jdkKey)) {
+    jdks.each { jdkKey ->
+        mavenJob(jobName(module.location, jdkKey)) {
 
-                description('''
-    <p>This build was automatically generated and any manual edits will be lost.</p>
-    <p>See <a href="https://cwiki.apache.org/confluence/display/SLING/Sling+Jenkins+Setup">Sling Jenkins Setup</a>
-    for more details</p>''')
+            description('''
+<p>This build was automatically generated and any manual edits will be lost.</p>
+<p>See <a href="https://cwiki.apache.org/confluence/display/SLING/Sling+Jenkins+Setup">Sling Jenkins Setup</a>
+for more details</p>''')
 
-                logRotator {
-                    numToKeep(15)
-                }
+            logRotator {
+                numToKeep(15)
+            }
 
-                scm {
-                    git {
-                        remote {
-                            github('apache/' + module.location)
-                        }
-                        branches('master')
+            scm {
+                git {
+                    remote {
+                        github('apache/' + module.location)
                     }
+                    branches('master')
                 }
+            }
 
-                blockOnUpstreamProjects()
-
-                triggers {
-                    snapshotDependencies(true)
-                    scm('H/15 * * * *')
-                    def rebuildFrequency = module.rebuildFrequency ? module.rebuildFrequency : '@weekly'
-                    cron(rebuildFrequency)
-                }
+            blockOnUpstreamProjects()
 
-                // timeout if the job takes 4 times longer than the average
-                // duration of the last 3 jobs. Defaults to 30 minutes if
-                // no previous job executions are found
-                wrappers {
-                    timeout {
-                        elastic(400, 3, 30)
-                    }
+            triggers {
+                snapshotDependencies(true)
+                scm('H/15 * * * *')
+                def rebuildFrequency = module.rebuildFrequency ? module.rebuildFrequency : '@weekly'
+                cron(rebuildFrequency)
+            }
 
-                    if ( module.enableXvfb ) {
-                        xvfb('Xvfb')
-                    }
+            // timeout if the job takes 4 times longer than the average
+            // duration of the last 3 jobs. Defaults to 30 minutes if
+            // no previous job executions are found
+            wrappers {
+                timeout {
+                    elastic(400, 3, 30)
+                }
 
-                    // INFRA-17090
-                    preBuildCleanup()
+                if ( module.enableXvfb ) {
+                    xvfb('Xvfb')
                 }
 
-                blockOnUpstreamProjects()
+                // INFRA-17090
+                preBuildCleanup()
+            }
 
-                jdk(jdkMapping.get(jdkKey))
+            blockOnUpstreamProjects()
 
-                mavenInstallation(defaultMvn)
+            jdk(jdkMapping.get(jdkKey))
 
-                // we have no use for archived artifacts since they are deployed on
-                // repository.apache.org so speed up the build a bit (and probably
-                // save on disk space)
-                archivingDisabled(true)
+            mavenInstallation(defaultMvn)
 
-                label(defaultSlave)
+            // we have no use for archived artifacts since they are deployed on
+            // repository.apache.org so speed up the build a bit (and probably
+            // save on disk space)
+            archivingDisabled(true)
 
-                // ensure that only one job deploys artifacts
-                // besides being less efficient, it's not sure which
-                // job is triggered first and we may end up with a
-                // mix of Java 7 and Java 8 artifacts for projects which
-                // use these 2 versions
-                def extraGoalsParams = module.extraGoalsParams ?: ""
-                def goal = module.mavenGoal ? module.mavenGoal : ( deploy ? "deploy" : "verify" )
-                goals( "-U clean ${goal} ${extraGoalsParams}")
+            label(defaultSlave)
 
-                publishers {
-                    if ( deploy && downstreamJobs ) {
-                        downstream(downstreamJobs)
-                    }
+            // ensure that only one job deploys artifacts
+            // besides being less efficient, it's not sure which
+            // job is triggered first and we may end up with a
+            // mix of Java 7 and Java 8 artifacts for projects which
+            // use these 2 versions
+            def extraGoalsParams = module.extraGoalsParams ?: ""
+            def goal = module.mavenGoal ? module.mavenGoal : ( deploy ? "deploy" : "verify" )
+            goals( "-U clean ${goal} ${extraGoalsParams}")
 
-                    if (module.archivePatterns) {
-                        archiveArtifacts() {
-                            module.archivePatterns.each { archiveEntry ->
-                                pattern(archiveEntry)
-                            }
-                        }
-                    }
+            publishers {
+                if ( deploy && downstreamJobs ) {
+                    downstream(downstreamJobs)
+                }
 
-                    // TODO - can we remove the glob and rely on the defaults?
-                    archiveJunit('**/target/surefire-reports/*.xml,**/target/failsafe-reports/*.xml') {
-                        allowEmptyResults()
+                if (module.archivePatterns) {
+                    archiveArtifacts() {
+                        module.archivePatterns.each { archiveEntry ->
+                            pattern(archiveEntry)
+                        }
                     }
-                    // send emails for each broken build, notify individuals as well
-                    mailer('commits@sling.apache.org', false, true)
                 }
 
-                deploy = false
+                // TODO - can we remove the glob and rely on the defaults?
+                archiveJunit('**/target/surefire-reports/*.xml,**/target/failsafe-reports/*.xml') {
+                    allowEmptyResults()
+                }
+                // send emails for each broken build, notify individuals as well
+                mailer('commits@sling.apache.org', false, true)
             }
+
+            deploy = false
         }
     }
 }