From 591756e5c978eed7b4ed8fa650854793dc29b536 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 25 Jan 2017 15:33:36 -0500 Subject: [PATCH] jjb: Add kversion ceiling to lttng-modules Signed-off-by: Michael Jeanson --- jobs/lttng-modules.yaml | 51 ++++++++++++++++++--- scripts/lttng-modules/master-vanilla.groovy | 35 ++++++++++++-- 2 files changed, 75 insertions(+), 11 deletions(-) diff --git a/jobs/lttng-modules.yaml b/jobs/lttng-modules.yaml index 0bfeb30..80897d8 100644 --- a/jobs/lttng-modules.yaml +++ b/jobs/lttng-modules.yaml @@ -96,6 +96,10 @@ 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}' @@ -410,31 +414,66 @@ 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': diff --git a/scripts/lttng-modules/master-vanilla.groovy b/scripts/lttng-modules/master-vanilla.groovy index 67da3be..7ba8974 100644 --- a/scripts/lttng-modules/master-vanilla.groovy +++ b/scripts/lttng-modules/master-vanilla.groovy @@ -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 { Integer major = 0; @@ -44,9 +56,13 @@ class kVersion implements Comparable { 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 { 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 { -- 2.34.1