jjb: Add kversion ceiling to lttng-modules
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 25 Jan 2017 20:33:36 +0000 (15:33 -0500)
committerMichael Jeanson <mjeanson@efficios.com>
Wed, 25 Jan 2017 20:33:45 +0000 (15:33 -0500)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
jobs/lttng-modules.yaml
scripts/lttng-modules/master-vanilla.groovy

index 0bfeb30e2489c786d7e8bd56dc68b23f0ede05d0..80897d82d41174518de7bfe185f9866f0eff3f56 100644 (file)
           name: 'kverfloor'
           default: '{kverfloor}'
           description: 'The lowest kernel version to build.'
+      - string:
+          name: 'kverceil'
+          default: '{kverceil}'
+          description: 'The highest kernel version to build. (excluded)'
       - string:
           name: 'kverfilter'
           default: '{kverfilter}'
     name: lttng-modules
     github_user: lttng
     github_name: lttng-modules
-    mversion:
-      - stable-2.7
-      - stable-2.8
-      - stable-2.9
-      - master
     jobs:
       - 'lttng-modules_{mversion}_{buildtype}-vanilla':
+          mversion:
+            - stable-2.9
+            - master
+          buildtype: build
+          kverfloor: v2.6.36
+          kverceil: ''
+          kverfilter: none
+      - 'lttng-modules_{mversion}_{buildtype}-vanilla':
+          mversion: stable-2.7
+          buildtype: build
+          kverfloor: v2.6.36
+          kverceil: v4.8-rc0
+          kverfilter: none
+      - 'lttng-modules_{mversion}_{buildtype}-vanilla':
+          mversion: stable-2.8
           buildtype: build
           kverfloor: v2.6.36
+          kverceil: v4.10-rc0
           kverfilter: none
       - 'lttng-modules_{mversion}_build-rt':
           mversion: master
       - 'lttng-modules_{mversion}_build-{uversion}':
+          mversion:
+            - stable-2.8
+            - stable-2.9
+            - master
           uversion:
             - trusty
             - xenial
       - 'lttng-modules_{mversion}_{buildtype}-vanilla':
+          mversion:
+            - stable-2.9
+            - master
+          buildtype: crossbuild
+          kverfloor: v3.16
+          kverceil: ''
+          kverfilter: stable-head
+      - 'lttng-modules_{mversion}_{buildtype}-vanilla':
+          mversion: stable-2.7
+          buildtype: crossbuild
+          kverfloor: v3.16
+          kverceil: v4.8-rc0
+          kverfilter: stable-head
+      - 'lttng-modules_{mversion}_{buildtype}-vanilla':
+          mversion: stable-2.8
           buildtype: crossbuild
           kverfloor: v3.16
+          kverceil: v4.10-rc0
           kverfilter: stable-head
       - 'lttng-modules_VERSION_param-build':
           arch: !!python/tuple [x86-32, x86-64]
       - 'lttng-modules_VERSION_param-crossbuild':
           cross_arch: !!python/tuple [armhf, arm64, powerpc, ppc64el]
-      - 'lttng-modules_{mversion}_cppcheck'
+      - 'lttng-modules_{mversion}_cppcheck':
+          mversion:
+            - stable-2.8
+            - stable-2.9
+            - master
       - 'lttng-modules_{mversion}_sloccount':
           mversion: master
       - 'lttng-modules_{mversion}_coverity':
index 67da3be7015407bec878c7b96b882b7fcb3da156..7ba8974015e18d807c04710bf50029dbbd040cbb 100644 (file)
@@ -23,6 +23,18 @@ import org.eclipse.jgit.api.Git
 import org.eclipse.jgit.lib.Ref
 
 
+class InvalidkVersionException extends Exception {
+  public InvalidkVersionException(String message) {
+    super(message)
+  }
+}
+
+class EmptykVersionException extends Exception {
+  public EmptykVersionException(String message) {
+    super(message)
+  }
+}
+
 class kVersion implements Comparable<kVersion> {
 
   Integer major = 0;
@@ -44,9 +56,13 @@ class kVersion implements Comparable<kVersion> {
     this.patch = 0
     this.rc = Integer.MAX_VALUE
 
+    if (!version) {
+      throw new EmptykVersionException("Empty kernel version")
+    }
+
     def match = version =~ /^v(\d+)\.(\d+)(\.(\d+))?(\.(\d+))?(-rc(\d+))?$/
     if (!match) {
-      throw new Exception("Invalid kernel version: ${version}")
+      throw new InvalidkVersionException("Invalid kernel version: ${version}")
     }
 
     Integer offset = 0;
@@ -140,19 +156,28 @@ class kVersion implements Comparable<kVersion> {
 def mversion = build.buildVariableResolver.resolve('mversion')
 def maxConcurrentBuild = build.buildVariableResolver.resolve('maxConcurrentBuild')
 def kgitrepo = build.buildVariableResolver.resolve('kgitrepo')
-def kverfloor = new kVersion(build.buildVariableResolver.resolve('kverfloor'))
+def kverfloor_raw = build.buildVariableResolver.resolve('kverfloor')
+def kverceil_raw = build.buildVariableResolver.resolve('kverceil')
 def kverfilter = build.buildVariableResolver.resolve('kverfilter')
 def job = Hudson.instance.getJob(build.buildVariableResolver.resolve('kbuildjob'))
 def currentJobName = build.project.getFullDisplayName()
 
+// Parse kernel versions
+def kverfloor = new kVersion(kverfloor_raw)
+def kverceil = ""
+
+try {
+    kverceil = new kVersion(kverceil_raw)
+} catch (EmptykVersionException e) {
+    kverceil = new kVersion("v" + Integer.MAX_VALUE + ".0.0")
+}
+
 // Get the out variable
 def config = new HashMap()
 def bindings = getBinding()
 config.putAll(bindings.getVariables())
 def out = config['out']
 
-def jlc = new jenkins.model.JenkinsLocationConfiguration()
-def jenkinsUrl = jlc.url
 
 // Get tags from git repository
 def refs = Git.lsRemoteRepository().setTags(true).setRemote(kgitrepo).call();
@@ -166,7 +191,7 @@ for (ref in refs) {
   if (match) {
     def v = new kVersion(match.group(1))
 
-    if (v >= kverfloor) {
+    if ((v >= kverfloor) && (v < kverceil)) {
       if (v.isRC()) {
         kversionsRC.add(v)
       } else {
This page took 0.028574 seconds and 4 git commands to generate.