sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject [sling-tooling-jenkins] branch feature/SLING-7245 updated: Revert "SLING-7245 - Validate pull requests using Jenkins"
Date Fri, 21 Dec 2018 13:54:57 GMT
This is an automated email from the ASF dual-hosted git repository.

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


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

commit cb5d079859dd45ee98f9f560cc78c07458b568ab
Author: Robert Munteanu <rombert@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 9cd1d35..92eef54 100644
--- a/create_jobs.groovy
+++ b/create_jobs.groovy
@@ -25,7 +25,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 ) {
@@ -91,137 +92,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
         }
     }
 }


Mime
View raw message