X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Flttng-modules%2Fmaster.groovy;h=2cc2a620bbf6e9daae60f783604fa6515eb7ea36;hb=f5f36c6810acdb85f898caf2cc94bfdf3cd52999;hp=0dbf61b475e03135e1d854a970baac665b76e747;hpb=3a01c580582e4697b1554ed3695e57ef5911e919;p=lttng-ci.git diff --git a/scripts/lttng-modules/master.groovy b/scripts/lttng-modules/master.groovy index 0dbf61b..2cc2a62 100644 --- a/scripts/lttng-modules/master.groovy +++ b/scripts/lttng-modules/master.groovy @@ -1,5 +1,5 @@ /** - * Copyright (C) 2016-2017 - Michael Jeanson + * Copyright (C) 2016-2018 - Michael Jeanson * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -171,6 +171,7 @@ class UbuntuKVersion implements Comparable { Integer umajor = 0 Integer uminor = 0 String suffix = "" + String strLTS = "" Boolean isLTS = false UbuntuKVersion() {} @@ -206,12 +207,15 @@ class UbuntuKVersion implements Comparable { //'Ubuntu-lts-4.8.0-27.29_16.04.1', //'Ubuntu-4.4.0-70.91', - def match = version =~ /^Ubuntu-(lts-)??(\d+)\.(\d+)\.(\d+)-(\d+)\.(\d+)(.*)??$/ + def match = version =~ /^Ubuntu-(lts-|hwe-)??(\d+)\.(\d+)\.(\d+)-(\d+)\.(\d+)(.*)??$/ if (!match) { throw new InvalidKVersionException("Invalid kernel version: ${version}") } - this.isLTS = match.group(1) != null + if (match.group(1) != null) { + this.isLTS = true + this.strLTS = match.group(1) + } // Major this.major = Integer.parseInt(match.group(2)) @@ -288,7 +292,7 @@ class UbuntuKVersion implements Comparable { String vString = "Ubuntu-" if (this.isLTS) { - vString = vString.concat("lts-") + vString = vString.concat("${this.strLTS}") } vString = vString.concat("${this.major}.${this.minor}.${this.patch}-${this.umajor}.${this.uminor}${this.suffix}") @@ -308,7 +312,7 @@ def kverfilter = build.buildVariableResolver.resolve('kverfilter') def uversion = build.buildVariableResolver.resolve('uversion') def job = Hudson.instance.getJob(build.buildVariableResolver.resolve('kbuildjob')) def currentJobName = build.project.getFullDisplayName() - +def gitmodpath = build.getEnvironment(listener).get('WORKSPACE') + "/src/lttng-modules" // Get the out variable def config = new HashMap() @@ -317,8 +321,12 @@ config.putAll(bindings.getVariables()) def out = config['out'] +// Get the lttng-modules git url +def gitmodrepo = Git.open(new File(gitmodpath)) +def mgitrepo = gitmodrepo.getRepository().getConfig().getString("remote", "origin", "url") + // Get tags from git repository -def refs = Git.lsRemoteRepository().setTags(true).setRemote(kgitrepo).call(); +def refs = Git.lsRemoteRepository().setTags(true).setRemote(kgitrepo).call() // Get kernel versions to build def kversions = [] @@ -330,11 +338,20 @@ def kversionFactory = "" if (uversion != null) { kversionFactory = new UbuntuKVersion() switch (uversion) { + case 'bionic': + matchStrs = [ + ~/^refs\/tags\/(Ubuntu-4\.15\.0-\d{1,3}?\.[\d]+)$/, +// ~/^refs\/tags\/(Ubuntu-hwe-4\.18\.0-.*_18\.04\.\d+)$/, + ] + break + case 'xenial': matchStrs = [ ~/^refs\/tags\/(Ubuntu-4\.4\.0-\d{1,3}?\.[\d]+)$/, - ~/^refs\/tags\/(Ubuntu-lts-4\.8\.0-.*_16\.04\.\d+)$/, - ~/^refs\/tags\/(Ubuntu-lts-4\.10\.0-.*_16\.04\.\d+)$/, + ~/^refs\/tags\/(Ubuntu-hwe-4\.8\.0-.*_16\.04\.\d+)$/, + ~/^refs\/tags\/(Ubuntu-hwe-4\.10\.0-.*_16\.04\.\d+)$/, + ~/^refs\/tags\/(Ubuntu-hwe-4\.13\.0-.*_16\.04\.\d+)$/, + ~/^refs\/tags\/(Ubuntu-hwe-4\.15\.0-.*_16\.04\.\d+)$/, ] blacklist = [ @@ -350,7 +367,7 @@ if (uversion != null) { break default: - println 'Unsupported Ubuntu version: ${uversion}' + println "Unsupported Ubuntu version: ${uversion}" throw new InterruptedException() break } @@ -360,6 +377,9 @@ if (uversion != null) { matchStrs = [ ~/^refs\/tags\/(v[\d\.]+(-rc(\d+))?)$/, ] + blacklist = [ + 'v3.2.3', + ] } // Parse kernel versions @@ -450,7 +470,8 @@ while ( kversions.size() != 0 || ongoingBuild.size() != 0 ) { def kversion = kversions.pop() def job_params = [ new StringParameterValue('mversion', mversion), - new StringParameterValue('kversion', kversion.toString()), + new StringParameterValue('mgitrepo', mgitrepo), + new StringParameterValue('ktag', kversion.toString()), new StringParameterValue('kgitrepo', kgitrepo), ] @@ -492,7 +513,7 @@ while ( kversions.size() != 0 || ongoingBuild.size() != 0 ) { // Print results def matrixParent = currentBuild.get() allBuilds.add(matrixParent) - def kernelStr = matrixParent.buildVariableResolver.resolve("kversion") + def kernelStr = matrixParent.buildVariableResolver.resolve("ktag") println "${matrixParent.fullDisplayName} (${kernelStr}) completed with status ${matrixParent.result}" // Process child runs of matrixBuild @@ -518,7 +539,7 @@ for (failedRun in failedRuns) { println "---Build report---" for (b in allBuilds) { - def kernelStr = b.buildVariableResolver.resolve("kversion") + def kernelStr = b.buildVariableResolver.resolve("ktag") println "${b.fullDisplayName} (${kernelStr}) completed with status ${b.result}" // Cleanup builds try { @@ -528,7 +549,7 @@ for (b in allBuilds) { // Mark this build failed if any child build has failed if (isFailed) { - build.getExecutor().interrupt(Result.FAILURE) + build.setResult(hudson.model.Result.FAILURE) } // EOF