[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [websites/build-kde-org/sok-work] /: Add downstream job support. Due to no plugins supporting
From: Scarlett Clark <scarlett () scarlettgatelyclark ! com>
Date: 2015-04-01 23:17:29
Message-ID: E1YdRt3-0008R1-CD () scm ! kde ! org
[Download RAW message or body]
Git commit 4e3000b5cb094e0c6c4c863162eed8ba5445533c by Scarlett Clark.
Committed on 01/04/2015 at 23:13.
Pushed by scarlettclark into branch 'sok-work'.
Add downstream job support. Due to no plugins supporting
regex job matching this had to be done through much duplication of code..
Add support for external deps grantlee and mlt.
M +43 -9 base.groovy
M +28 -4 config/identifiers.json
M +1 -1 helpers/ConditionalProjectHelper.groovy
M +4 -4 helpers/MatrixProjectHelper.groovy
M +4 -8 helpers/ProjectMiscHelpers.groovy
http://commits.kde.org/websites/build-kde-org/4e3000b5cb094e0c6c4c863162eed8ba5445533c
diff --git a/base.groovy b/base.groovy
index 9e7c773..127a066 100644
--- a/base.groovy
+++ b/base.groovy
@@ -56,8 +56,6 @@ while(projects.hasNext()) {
logrotator = json.logrotator.tokenize( ',' )
}
def (daysToKeep, numToKeep, artifactDaysToKeep, artifactNumToKeep) = \
nondefaultlogrotator ?: ["-1","50","-1","-1"]
- //downstream set in identifiers.json
- ArrayList setdownstream = json.downstream ?: null
String jobdesc = projectxml.description ?: "KDE job"
/* Matrix variables needed later, Default values.
@@ -110,17 +108,30 @@ while(projects.hasNext()) {
def JOBCONFIG = new \
java.io.FileReader("${JENKINS_HOME}/scripts/dependencies/logical-module-structure") \
def result = new groovy.json.JsonSlurper().parse(JOBCONFIG) Object metadata = result
+ /*Downstream job set in identifiers.json
+ * We do not have enough slave support to handle more than one each.
+ * We need to find the downstream branch in the current branchgroup
+ * This is set up here due to need the need of the metadata object.
+ */
+ String setdownstream = json.downstream ?: null
+ //Create a variable to hold the downstream branch information we need later.
+ def downstreampath
+ if (setdownstream != null) {
+ Map downstreamxml = createKDEProjects("${WORKSPACE}", setdownstream)
+ def dspath = downstreamxml.path
+ downstreampath = findPath(dspath, metadata, setdownstream, external)
+ }
// Now with the metadata we need to search for the <path> and find data and or \
wildcards. def grouppath = findPath(path, metadata, jobname, external)
// Remove pesky null entries.
if (external == true ) {
} else {
- grouppath.removeAll([null])
+ grouppath.removeAll([null])
}
// Put result in a map
def newmap
-
+ def downstreammap
if (repo =~ 'svn:/') {
println "Creating SVN job ${jobname}"
} else if (external == true && json.bzr != null) {
@@ -132,6 +143,11 @@ while(projects.hasNext()) {
continue;
} else {
newmap = [:] << grouppath
+
+ }
+ if (downstreampath != null) {
+ downstreampath.removeAll([null])
+ downstreammap = [:] << downstreampath
}
// Retrieve the branchGroup/branch map from the path result.
def branchlist
@@ -148,13 +164,31 @@ while(projects.hasNext()) {
iterator.remove()
}
}
- }
+ }
+ //Collect the branchGroup/branch information for the downstream job.
+ def downstreambranchlist
+ if (downstreammap != null) {
+ downstreambranchlist = downstreammap.values() as HashMap;
+ def iterator = downstreambranchlist.entrySet().iterator()
+ while (iterator.hasNext()) {
+ if (!iterator.next().value) {
+ iterator.remove()
+ }
+ }
+ }
// Gather the branchGroup keys and iterate branchGroup as a closure
def branchgroups = branchlist.keySet() as String[];
// Now for each branchGroup determine branchGroup specific values.
branchgroups.each { branchGroup ->
- def bgdownstream = createDownstream(setdownstream, branchGroup)
+ // Now that we have a branchGroup value we need to grab the correct branch
+ // of the downstream project. And finally call the name builder and pass to the \
DSL. + def bgdownstream
+ if (downstreambranchlist != null) {
+ String currbranch
+ currbranch = downstreambranchlist.getAt(branchGroup).toString().trim()
+ bgdownstream = createDownstream(setdownstream, currbranch, branchGroup)
+ }
try{
branch = branchlist.getAt(branchGroup).toString().trim()
/* Here we determine the combinations we want to build.
@@ -258,9 +292,9 @@ while(projects.hasNext()) {
if (jobname !=~ 'qt') {
cobertura('build/CoberturaLcovResults.xml') }
//set some downstreams to control some build order (disabled until logic sorted)
-// if (bgdownstream != null) {
-// downstream(bgdownstream, "UNSTABLE")
-// }
+ if (bgdownstream != null) {
+ downstream(bgdownstream.toString(), 'UNSTABLE')
+ }
createEmailNotifications(jobname, email)
//createIRCNotifications(jobname, irc)
diff --git a/config/identifiers.json b/config/identifiers.json
index 701dafe..2885313 100644
--- a/config/identifiers.json
+++ b/config/identifiers.json
@@ -376,8 +376,7 @@
"publishers":"true"
},
{
- "projectname":"digikam",
- "downstream":["libkface"],
+ "projectname":"digikam",
"html5":"false",
"cron":"@weekly",
"publishers":"true"
@@ -2503,6 +2502,7 @@
},
{
"projectname":"libkface",
+ "downstream":"digikam",
"html5":"false",
"cron":"@weekly",
"publishers":"true"
@@ -3104,6 +3104,7 @@
{
"projectname":"qt5",
"logrotator":"-1,5,-1,-1",
+ "downstream":"extra-cmake-modules",
"html5":"false",
"cron":"@weekly",
"publishers":"true",
@@ -3632,6 +3633,29 @@
"html5":"false",
"cron":"@weekly",
"publishers":"true"
- }
-
+ },
+ {
+ "projectname":"mlt",
+ "git":"git://github.com/mltframework/mlt.git",
+ "branchgroups": {
+ "kf5-qt5":"master",
+ "stable-kf5-qt5":"master"
+ },
+ "downstream":"kdeenlive",
+ "html5":"false",
+ "cron":"@weekly",
+ "publishers":"true"
+ },
+ {
+ "projectname":"grantlee",
+ "git":"https://github.com/steveire/grantlee.git",
+ "branchgroups": {
+ "kf5-qt5":"master",
+ "stable-kf5-qt5":"master"
+ },
+ "downstream":"kdevplatform",
+ "html5":"false",
+ "cron":"@weekly",
+ "publishers":"true"
+ }
]
diff --git a/helpers/ConditionalProjectHelper.groovy \
b/helpers/ConditionalProjectHelper.groovy index 0087490..e69b4bb 100644
--- a/helpers/ConditionalProjectHelper.groovy
+++ b/helpers/ConditionalProjectHelper.groovy
@@ -205,7 +205,7 @@ class ConditionalProjectHelper {
/* This section defines the command for each platform/compiler. NOTE: Possibly \
better in a config script */ def buildcommand
if (platform == "Windows" && compiler.contains('vs2013')){
- buildcommand = 'CALL d:/kderoot/kdeenv.bat && python \
%JENKINS_SLAVE_HOME%/tools/perform-build.py ' + '--project ' + "${projectname}" + ' \
--branchGroup ' + "${branchGroup}" + ' --compiler ' + 'vs2013' + ' --platform ' + \
'windows64' + ' --sources ' + '%WORKSPACE%' + buildcommand = 'CALL \
d:/kderoot/emerge/kdeenv.bat && c:/python34/python.exe \
%JENKINS_SLAVE_HOME%/tools/perform-build.py ' + '--project ' + "${projectname}" + ' \
--branchGroup ' + "${branchGroup}" + ' --compiler ' + 'vs2013' + ' --platform ' + \
'windows64' + ' --sources ' + '%WORKSPACE%' } else if (platform == "Linux" && \
compiler.contains('gcc')){ buildcommand = 'python -u \
${JENKINS_SLAVE_HOME}/tools/perform-build.py ' + '--project ' + "${projectname}" + ' \
--branchGroup ' + "${branchGroup}" + ' --compiler ' + 'gcc' + ' --platform ' + \
'linux64' + ' --sources ' + '${WORKSPACE}' } else if (platform == "OSX" && \
compiler.contains('clang')){
diff --git a/helpers/MatrixProjectHelper.groovy b/helpers/MatrixProjectHelper.groovy
index 4e2734c..af12742 100644
--- a/helpers/MatrixProjectHelper.groovy
+++ b/helpers/MatrixProjectHelper.groovy
@@ -55,11 +55,11 @@ class MatrixProjectHelper {
} else if (branchGroup == "kf5-qt5") {
//Disabling Win and OSX temporarily
//return platforms
- return platforms = ["Linux",null,null]
+ return platforms = ["Linux","Windows",null]
} else if (branchGroup == "stable-kf5-qt5") {
//Disabling Win and OSX temporarily
//return platforms
- return platforms = ["Linux",null,null]
+ return platforms = ["Linux","Windows",null]
}
}
static ArrayList determineCompilers(String branchGroup, ArrayList compilers) {
@@ -71,11 +71,11 @@ class MatrixProjectHelper {
} else if (branchGroup == "kf5-qt5") {
// Disabling Win and OSX temporarily
//return compilers
- return compilers = ["gcc",null,null]
+ return compilers = ["gcc","vs2013",null]
} else if (branchGroup == "stable-kf5-qt5") {
// Disabling Win and OSX temporarily
//return compilers
- return compilers = ["gcc",null,null]
+ return compilers = ["gcc","vs2013",null]
}
}
diff --git a/helpers/ProjectMiscHelpers.groovy b/helpers/ProjectMiscHelpers.groovy
index 0bdcb2f..881bdd8 100644
--- a/helpers/ProjectMiscHelpers.groovy
+++ b/helpers/ProjectMiscHelpers.groovy
@@ -50,14 +50,10 @@ class ProjectMiscHelpers {
println "${xmlprojectname} is a new job that needs to be added to identifiers \
please." }
}*/
- static ArrayList createDownstream(ArrayList downstream, String branchGroup) {
- def bgdownstream = new ArrayList()
- def downstreamnew
- downstream.each {
- downstreamnew = downstream + '-' + "${branchGroup}"
- bgdownstream.push(downstreamnew)
- }
- return bgdownstream
+ static String createDownstream(String downstream, String branch, String \
branchGroup) { + def String downstreamnew
+ downstreamnew = downstream + ' ' + branch + ' ' + branchGroup
+ return downstreamnew
}
static Closure miscParent() {
// We always want the "Parent" to build on a Linux builder
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic