Jenkins DLS: Remove support for multiple JDKs, it was not used and did not work anyway due to name-clashes

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1776649 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2016-12-30 22:12:14 +00:00
parent a30315de20
commit e66d78a388
1 changed files with 193 additions and 195 deletions

View File

@ -16,17 +16,17 @@ def poijobs = [
// as part of the Ant build // as part of the Ant build
addShell: 'wget -O lib/findbugs-noUpdateChecks-2.0.3.zip http://downloads.sourceforge.net/project/findbugs/findbugs/2.0.3/findbugs-noUpdateChecks-2.0.3.zip?download=' addShell: 'wget -O lib/findbugs-noUpdateChecks-2.0.3.zip http://downloads.sourceforge.net/project/findbugs/findbugs/2.0.3/findbugs-noUpdateChecks-2.0.3.zip?download='
], ],
[ name: 'POI-DSL-1.8', jdks: ['1.8'], trigger: 'H */12 * * *', [ name: 'POI-DSL-1.8', jdk: '1.8', trigger: 'H */12 * * *',
// ubuntu-4 repeatedely failed during Findbugs results collection // ubuntu-4 repeatedely failed during Findbugs results collection
slaveAdd: '&&!ubuntu-4' slaveAdd: '&&!ubuntu-4'
], ],
[ name: 'POI-DSL-OpenJDK', jdks: ['OpenJDK'], trigger: 'H */12 * * *', [ name: 'POI-DSL-OpenJDK', jdk: 'OpenJDK', trigger: 'H */12 * * *',
// H13-H20 (Ubuntu 16.04) do not have OpenJDK 6 installed, see https://issues.apache.org/jira/browse/INFRA-12880 // H13-H20 (Ubuntu 16.04) do not have OpenJDK 6 installed, see https://issues.apache.org/jira/browse/INFRA-12880
slaveAdd: '&&!H13&&!H14&&!H15&&!H16&&!H17&&!H18&&!H19&&!H20&&!ubuntu-eu2', slaveAdd: '&&!H13&&!H14&&!H15&&!H16&&!H17&&!H18&&!H19&&!H20&&!ubuntu-eu2',
// the JDK is missing on some slaves so builds are unstable // the JDK is missing on some slaves so builds are unstable
skipcigame: true skipcigame: true
], ],
[ name: 'POI-DSL-1.9', jdks: ['1.9'], trigger: triggerSundays, [ name: 'POI-DSL-1.9', jdk: '1.9', trigger: triggerSundays,
properties: ['-Dmaxpermsize=-Dthis.is.a.dummy=true', properties: ['-Dmaxpermsize=-Dthis.is.a.dummy=true',
'-Djava9addmods=--add-modules=java.xml.bind', '-Djava9addmods=--add-modules=java.xml.bind',
'-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true', '-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
@ -37,7 +37,7 @@ def poijobs = [
'-Djava.locale.providers=JRE,CLDR'], '-Djava.locale.providers=JRE,CLDR'],
skipcigame: true skipcigame: true
], ],
[ name: 'POI-DSL-IBM-JDK', jdks: ['IBMJDK'], trigger: triggerSundays, noScratchpad: true, [ name: 'POI-DSL-IBM-JDK', jdk: 'IBMJDK', trigger: triggerSundays, noScratchpad: true,
// some OOXML tests fail with strange XML parsing errors and missing JCE unlimited strength requirements // some OOXML tests fail with strange XML parsing errors and missing JCE unlimited strength requirements
disabled: true, skipcigame: true disabled: true, skipcigame: true
], ],
@ -53,20 +53,20 @@ def poijobs = [
], ],
[ name: 'POI-DSL-regenerate-javadoc', trigger: triggerSundays, javadoc: true [ name: 'POI-DSL-regenerate-javadoc', trigger: triggerSundays, javadoc: true
], ],
[ name: 'POI-DSL-API-Check', jdks: ['1.7'], trigger: '@daily', apicheck: true [ name: 'POI-DSL-API-Check', jdk: '1.7', trigger: '@daily', apicheck: true
], ],
[ name: 'POI-DSL-Gradle', jdks: ['1.7'], trigger: triggerSundays, email: 'centic@apache.org', gradle: true, [ name: 'POI-DSL-Gradle', jdk: '1.7', trigger: triggerSundays, email: 'centic@apache.org', gradle: true,
// Gradle will not run any tests if the code is up-to-date, therefore manually mark the files as updated // Gradle will not run any tests if the code is up-to-date, therefore manually mark the files as updated
addShell: 'touch --no-create build/*/build/test-results/test/TEST-*.xml' addShell: 'touch --no-create build/*/build/test-results/test/TEST-*.xml'
], ],
[ name: 'POI-DSL-no-scratchpad', trigger: triggerSundays, noScratchpad: true [ name: 'POI-DSL-no-scratchpad', trigger: triggerSundays, noScratchpad: true
], ],
[ name: 'POI-DSL-SonarQube', jdks: ['1.8'], trigger: 'H 9 * * *', maven: true, sonar: true [ name: 'POI-DSL-SonarQube', jdk: '1.8', trigger: 'H 9 * * *', maven: true, sonar: true
], ],
] ]
def svnBase = 'https://svn.apache.org/repos/asf/poi/trunk' def svnBase = 'https://svn.apache.org/repos/asf/poi/trunk'
def defaultJdks = ['1.6'] def defaultJdk = '1.6'
def defaultTrigger = 'H/15 * * * *' def defaultTrigger = 'H/15 * * * *'
def defaultEmail = 'dev@poi.apache.org' def defaultEmail = 'dev@poi.apache.org'
def defaultAnt = 'Ant (latest)' def defaultAnt = 'Ant (latest)'
@ -83,236 +83,234 @@ def jdkMapping = [
poijobs.each { poijob -> poijobs.each { poijob ->
def jdks = poijob.jdks ?: defaultJdks def jdkKey = poijob.jdk ?: defaultJdk
def trigger = poijob.trigger ?: defaultTrigger def trigger = poijob.trigger ?: defaultTrigger
def email = poijob.email ?: defaultEmail def email = poijob.email ?: defaultEmail
def slaves = defaultSlaves + (poijob.slaveAdd ?: '') def slaves = defaultSlaves + (poijob.slaveAdd ?: '')
jdks.each { jdkKey -> job(poijob.name) {
job(poijob.name) { if (poijob.disabled) {
if (poijob.disabled) { disabled()
disabled() }
}
def defaultDesc = '''
def defaultDesc = '''
<img src="http://poi.apache.org/resources/images/project-logo.jpg" /> <img src="http://poi.apache.org/resources/images/project-logo.jpg" />
<p> <p>
Apache POI - the Java API for Microsoft Documents Apache POI - the Java API for Microsoft Documents
</p> </p>
<p> <p>
<b>This is an automatically generated Job Config, do not edit it here! <b>This is an automatically generated Job Config, do not edit it here!
Instead change the Jenkins Job DSL at <a href="http://svn.apache.org/repos/asf/poi/trunk/jenkins">http://svn.apache.org/repos/asf/poi/trunk/jenkins</a>, Instead change the Jenkins Job DSL at <a href="http://svn.apache.org/repos/asf/poi/trunk/jenkins">http://svn.apache.org/repos/asf/poi/trunk/jenkins</a>,
see <a href="https://github.com/jenkinsci/job-dsl-plugin/wiki">https://github.com/jenkinsci/job-dsl-plugin/wiki</a> see <a href="https://github.com/jenkinsci/job-dsl-plugin/wiki">https://github.com/jenkinsci/job-dsl-plugin/wiki</a>
for more details about the DSL.</b> for more details about the DSL.</b>
</p>''' </p>'''
description( defaultDesc + description( defaultDesc +
(poijob.apicheck ? (poijob.apicheck ?
''' '''
<p> <p>
<b><a href="https://builds.apache.org/analysis/dashboard?id=org.apache.poi%3Apoi-parent&did=1" target="_blank">Sonar reports</a></b> - <b><a href="https://builds.apache.org/analysis/dashboard?id=org.apache.poi%3Apoi-parent&did=1" target="_blank">Sonar reports</a></b> -
<p> <p>
<b><a href="lastSuccessfulBuild/artifact/build/main/build/reports/japi.html">API Check POI</a></b> <b><a href="lastSuccessfulBuild/artifact/build/main/build/reports/japi.html">API Check POI</a></b>
<b><a href="lastSuccessfulBuild/artifact/build/ooxml/build/reports/japi.html">API Check POI-OOXML</a></b> <b><a href="lastSuccessfulBuild/artifact/build/ooxml/build/reports/japi.html">API Check POI-OOXML</a></b>
<b><a href="lastSuccessfulBuild/artifact/build/excelant/build/reports/japi.html">API Check POI-Excelant</a></b> <b><a href="lastSuccessfulBuild/artifact/build/excelant/build/reports/japi.html">API Check POI-Excelant</a></b>
<b><a href="lastSuccessfulBuild/artifact/build/scratchpad/build/reports/japi.html">API Check POI-Scratchpad</a></b> <b><a href="lastSuccessfulBuild/artifact/build/scratchpad/build/reports/japi.html">API Check POI-Scratchpad</a></b>
</p> </p>
''' : ''' :
''' '''
<p> <p>
<b><a href="lastSuccessfulBuild/findbugsResult/" target="_blank">Findbugs report of latest build</a></b> - <b><a href="lastSuccessfulBuild/findbugsResult/" target="_blank">Findbugs report of latest build</a></b> -
<b><a href="https://builds.apache.org/analysis/dashboard?id=org.apache.poi%3Apoi-parent&did=1" target="_blank">Sonar reports</a></b> - <b><a href="https://builds.apache.org/analysis/dashboard?id=org.apache.poi%3Apoi-parent&did=1" target="_blank">Sonar reports</a></b> -
<b><a href="lastSuccessfulBuild/artifact/build/coverage/index.html" target="_blank">Coverage of latest build</a></b> <b><a href="lastSuccessfulBuild/artifact/build/coverage/index.html" target="_blank">Coverage of latest build</a></b>
</p> </p>
''')) '''))
logRotator { logRotator {
numToKeep(5) numToKeep(5)
artifactNumToKeep(1) artifactNumToKeep(1)
}
label(slaves)
environmentVariables {
env('LANG', 'en_US.UTF-8')
if(jdkKey == '1.9') {
env('ANT_OPTS', '--add-modules=java.xml.bind')
} }
label(slaves) }
environmentVariables { wrappers {
env('LANG', 'en_US.UTF-8') timeout {
if(jdkKey == '1.9') { absolute(180)
env('ANT_OPTS', '--add-modules=java.xml.bind') abortBuild()
writeDescription('Build was aborted due to timeout')
}
if(poijob.sonar) {
configure { project ->
project / buildWrappers << 'hudson.plugins.sonar.SonarBuildWrapper' {}
} }
} }
wrappers { }
timeout { jdk(jdkMapping.get(jdkKey))
absolute(180) scm {
abortBuild() svn(svnBase) { svnNode ->
writeDescription('Build was aborted due to timeout') svnNode / browser(class: 'hudson.scm.browsers.ViewSVN') /
} url << 'http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN'
if(poijob.sonar) {
configure { project ->
project / buildWrappers << 'hudson.plugins.sonar.SonarBuildWrapper' {}
} }
} }
} triggers {
jdk(jdkMapping.get(jdkKey)) scm(trigger)
scm { }
svn(svnBase) { svnNode ->
svnNode / browser(class: 'hudson.scm.browsers.ViewSVN') /
url << 'http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN'
}
}
triggers {
scm(trigger)
}
def shellcmds = '# show which files are currently modified in the working copy\n' +
'svn status\n' +
'\n' +
'echo Java-Home: $JAVA_HOME\n' +
'ls -al $JAVA_HOME/\n' +
'\n' +
(poijob.shell ?: '') + '\n' +
'# ignore any error message\n' +
'exit 0\n'
// Create steps and publishers depending on the type of Job that is selected def shellcmds = '# show which files are currently modified in the working copy\n' +
if(poijob.maven) { 'svn status\n' +
steps { '\n' +
shell(shellcmds) 'echo Java-Home: $JAVA_HOME\n' +
maven { 'ls -al $JAVA_HOME/\n' +
goals('clean') '\n' +
rootPOM('sonar/pom.xml') (poijob.shell ?: '') + '\n' +
localRepository(LocalRepositoryLocation.LOCAL_TO_WORKSPACE) '# ignore any error message\n' +
mavenInstallation('maven-3.2.1') 'exit 0\n'
// Create steps and publishers depending on the type of Job that is selected
if(poijob.maven) {
steps {
shell(shellcmds)
maven {
goals('clean')
rootPOM('sonar/pom.xml')
localRepository(LocalRepositoryLocation.LOCAL_TO_WORKSPACE)
mavenInstallation('maven-3.2.1')
}
/* Currently not done, let's see if it is still necessary:
# Maven-Download fails for strange reasons, try to workaround...
mkdir -p sonar/ooxml-schema-security/target/schemas && wget -O sonar/ooxml-schema-security/target/schemas/xmldsig-core-schema.xsd http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd
*/
maven {
if(poijob.sonar) {
goals('compile $SONAR_MAVEN_GOAL -Dsonar.host.url=$SONAR_HOST_URL')
} else {
goals('package')
} }
/* Currently not done, let's see if it is still necessary: rootPOM('sonar/pom.xml')
# Maven-Download fails for strange reasons, try to workaround... mavenOpts('-Xmx2g')
mkdir -p sonar/ooxml-schema-security/target/schemas && wget -O sonar/ooxml-schema-security/target/schemas/xmldsig-core-schema.xsd http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd mavenOpts('-Xms256m')
*/ mavenOpts('-XX:MaxPermSize=512m')
maven { mavenOpts('-XX:-OmitStackTraceInFastThrow')
if(poijob.sonar) { localRepository(LocalRepositoryLocation.LOCAL_TO_WORKSPACE)
goals('compile $SONAR_MAVEN_GOAL -Dsonar.host.url=$SONAR_HOST_URL') mavenInstallation('maven-3.2.1')
} else { }
goals('package') }
} publishers {
rootPOM('sonar/pom.xml') if (!poijob.skipcigame) {
mavenOpts('-Xmx2g') configure { project ->
mavenOpts('-Xms256m') project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
mavenOpts('-XX:MaxPermSize=512m')
mavenOpts('-XX:-OmitStackTraceInFastThrow')
localRepository(LocalRepositoryLocation.LOCAL_TO_WORKSPACE)
mavenInstallation('maven-3.2.1')
} }
} }
publishers { mailer(email, false, false)
if (!poijob.skipcigame) { }
configure { project -> } else if (poijob.javadoc) {
project / publishers << 'hudson.plugins.cigame.GamePublisher' {} steps {
} shell(shellcmds)
} ant {
mailer(email, false, false) targets(['clean', 'javadocs'] + (poijob.properties ?: []))
prop('coverage.enabled', true)
// Properties did not work, so I had to use targets instead
//properties(poijob.properties ?: '')
antInstallation(defaultAnt)
} }
} else if (poijob.javadoc) { shell('zip -r build/javadocs.zip build/tmp/site/build/site/apidocs')
steps { }
shell(shellcmds) publishers {
if (!poijob.skipcigame) {
configure { project ->
project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
}
}
mailer(email, false, false)
}
} else if (poijob.apicheck) {
steps {
shell(shellcmds)
gradle {
tasks('japicmp')
useWrapper(false)
}
}
publishers {
archiveArtifacts('build/*/build/reports/japi.html')
if (!poijob.skipcigame) {
configure { project ->
project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
}
}
mailer(email, false, false)
}
} else {
steps {
shell(shellcmds)
if(poijob.addShell) {
shell(poijob.addShell)
}
// For Jobs that should still have the default set of publishers we can configure different steps here
if(poijob.gradle) {
gradle {
tasks('check')
useWrapper(false)
}
} else if (poijob.noScratchpad) {
ant { ant {
targets(['clean', 'javadocs'] + (poijob.properties ?: [])) targets(['clean', 'compile-all'] + (poijob.properties ?: []))
prop('coverage.enabled', true)
antInstallation(defaultAnt)
}
ant {
targets(['-Dscratchpad.ignore=true', 'jacocotask', 'test-main', 'test-ooxml', 'test-excelant', 'test-ooxml-lite', 'testcoveragereport'] + (poijob.properties ?: []))
antInstallation(defaultAnt)
}
} else {
ant {
targets(['clean', 'jenkins'] + (poijob.properties ?: []))
prop('coverage.enabled', true) prop('coverage.enabled', true)
// Properties did not work, so I had to use targets instead // Properties did not work, so I had to use targets instead
//properties(poijob.properties ?: '') //properties(poijob.properties ?: '')
antInstallation(defaultAnt) antInstallation(defaultAnt)
} }
shell('zip -r build/javadocs.zip build/tmp/site/build/site/apidocs') ant {
} targets(['run'] + (poijob.properties ?: []))
publishers { buildFile('src/integrationtest/build.xml')
if (!poijob.skipcigame) { // Properties did not work, so I had to use targets instead
configure { project -> //properties(poijob.properties ?: '')
project / publishers << 'hudson.plugins.cigame.GamePublisher' {} antInstallation(defaultAnt)
}
}
mailer(email, false, false)
}
} else if (poijob.apicheck) {
steps {
shell(shellcmds)
gradle {
tasks('japicmp')
useWrapper(false)
} }
} }
publishers { }
archiveArtifacts('build/*/build/reports/japi.html') publishers {
if (!poijob.skipcigame) { findbugs('build/findbugs.xml', false) {
configure { project -> healthLimits(3, 20)
project / publishers << 'hudson.plugins.cigame.GamePublisher' {} thresholdLimit('low')
} defaultEncoding('UTF-8')
}
mailer(email, false, false)
} }
} else { // in archive, junit and jacoco publishers, matches beneath build/*/build/... are for Gradle-build results
steps { archiveArtifacts('build/dist/*.tar.gz,build/findbugs.html,build/coverage/**,build/integration-test-results/**,ooxml-lib/**,build/*/build/libs/*.jar')
shell(shellcmds) warnings(['Java Compiler (javac)', 'JavaDoc Tool'], null) {
if(poijob.addShell) { resolveRelativePaths()
shell(poijob.addShell) }
} archiveJunit('build/ooxml-test-results/*.xml,build/scratchpad-test-results/*.xml,build/test-results/*.xml,build/excelant-test-results/*.xml,build/integration-test-results/*.xml,build/*/build/test-results/test/TEST-*.xml') {
// For Jobs that should still have the default set of publishers we can configure different steps here testDataPublishers {
if(poijob.gradle) { publishTestStabilityData()
gradle {
tasks('check')
useWrapper(false)
}
} else if (poijob.noScratchpad) {
ant {
targets(['clean', 'compile-all'] + (poijob.properties ?: []))
prop('coverage.enabled', true)
antInstallation(defaultAnt)
}
ant {
targets(['-Dscratchpad.ignore=true', 'jacocotask', 'test-main', 'test-ooxml', 'test-excelant', 'test-ooxml-lite', 'testcoveragereport'] + (poijob.properties ?: []))
antInstallation(defaultAnt)
}
} else {
ant {
targets(['clean', 'jenkins'] + (poijob.properties ?: []))
prop('coverage.enabled', true)
// Properties did not work, so I had to use targets instead
//properties(poijob.properties ?: '')
antInstallation(defaultAnt)
}
ant {
targets(['run'] + (poijob.properties ?: []))
buildFile('src/integrationtest/build.xml')
// Properties did not work, so I had to use targets instead
//properties(poijob.properties ?: '')
antInstallation(defaultAnt)
}
} }
} }
publishers { jacocoCodeCoverage {
findbugs('build/findbugs.xml', false) { classPattern('build/classes,build/examples-classes,build/excelant-classes,build/ooxml-classes,build/scratchpad-classes,build/*/build/classes')
healthLimits(3, 20) execPattern('build/*.exec,build/*/build/jacoco/*.exec')
thresholdLimit('low') sourcePattern('src/java,src/excelant/java,src/ooxml/java,src/scratchpad/src')
defaultEncoding('UTF-8') exclusionPattern('com/microsoft/**,org/openxmlformats/**,org/etsi/**,org/w3/**,schemaorg*/**,schemasMicrosoft*/**,org/apache/poi/hdf/model/hdftypes/definitions/*.class,org/apache/poi/hwpf/model/types/*.class,org/apache/poi/hssf/usermodel/DummyGraphics2d.class,org/apache/poi/sl/draw/binding/*.class')
} }
// in archive, junit and jacoco publishers, matches beneath build/*/build/... are for Gradle-build results
archiveArtifacts('build/dist/*.tar.gz,build/findbugs.html,build/coverage/**,build/integration-test-results/**,ooxml-lib/**,build/*/build/libs/*.jar')
warnings(['Java Compiler (javac)', 'JavaDoc Tool'], null) {
resolveRelativePaths()
}
archiveJunit('build/ooxml-test-results/*.xml,build/scratchpad-test-results/*.xml,build/test-results/*.xml,build/excelant-test-results/*.xml,build/integration-test-results/*.xml,build/*/build/test-results/test/TEST-*.xml') {
testDataPublishers {
publishTestStabilityData()
}
}
jacocoCodeCoverage {
classPattern('build/classes,build/examples-classes,build/excelant-classes,build/ooxml-classes,build/scratchpad-classes,build/*/build/classes')
execPattern('build/*.exec,build/*/build/jacoco/*.exec')
sourcePattern('src/java,src/excelant/java,src/ooxml/java,src/scratchpad/src')
exclusionPattern('com/microsoft/**,org/openxmlformats/**,org/etsi/**,org/w3/**,schemaorg*/**,schemasMicrosoft*/**,org/apache/poi/hdf/model/hdftypes/definitions/*.class,org/apache/poi/hwpf/model/types/*.class,org/apache/poi/hssf/usermodel/DummyGraphics2d.class,org/apache/poi/sl/draw/binding/*.class')
}
if (!poijob.skipcigame) { if (!poijob.skipcigame) {
configure { project -> configure { project ->
project / publishers << 'hudson.plugins.cigame.GamePublisher' {} project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
}
} }
mailer(email, false, false)
} }
mailer(email, false, false)
} }
} }
} }