// This script is used as input to the Jenkins Job DSL plugin to create all the build-jobs that
// Apache POI uses on the public Jenkins instance at https://builds.apache.org/view/P/view/POI/
//
// See https://github.com/jenkinsci/job-dsl-plugin/wiki for information about the DSL, you can
// use http://job-dsl.herokuapp.com/ to validate the code before checkin
//
def triggerSundays = '''
# only run this once per week on Sundays
H H * * 0
'''
def xercesUrl = 'http://repo1.maven.org/maven2/xerces/xercesImpl/2.6.1/xercesImpl-2.6.1.jar'
def xercesLib = 'compile-lib/xercesImpl-2.6.1.jar'
def poijobs = [
[ name: 'POI-DSL-1.8', 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
slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam5&&!beam6&&!beam7&&!beam8' +
'&&!H0&&!H1&&!H2&&!H3&&!H4&&!H5&&!H6&&!H7&&!H8&&!H9&&!H10&&!H11' +
'&&!qnode3' +
'&&!ubuntu-1&&!ubuntu-2&&!ubuntu-4&&!ubuntu-5&&!ubuntu-6&&!ubuntu-eu2&&!ubuntu-us1',
// the JDK is missing on some slaves so builds are unstable
skipcigame: true
],
[ name: 'POI-DSL-1.9', jdk: '1.9', trigger: triggerSundays,
properties: ['-Djava9addmods=--add-modules=java.xml.bind',
'-Djavadoc9addmods=--add-modules=java.xml.bind',
'-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
'-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
'-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
'-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
'-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
'-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
'-Djava9addopens6=--add-opens=java.base/java.lang=java.xml.bind',
'-Djava.locale.providers=JRE,CLDR'],
skipcigame: true
],
[ name: 'POI-DSL-1.10', jdk: '1.10', trigger: triggerSundays,
properties: ['-Djava9addmods=--add-modules=java.xml.bind',
'-Djavadoc9addmods=--add-modules=java.xml.bind',
'-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
'-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
'-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
'-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
'-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
'-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
'-Djava9addopens6=--add-opens=java.base/java.lang=java.xml.bind',
'-Djava.locale.providers=JRE,CLDR'],
skipcigame: true
],
[ name: 'POI-DSL-1.11', jdk: '1.11', trigger: triggerSundays,
// Nodes beam* do not yet have JDK 11 installed
slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam6&&!beam7&&!beam8&&!beam9&&!beam10&&!beam11&&!beam12&&!beam13&&!beam14&&!beam15&&!beam16',
properties: ['-Djava9addmods=-Dthis.is.a.dummy=true',
'-Djavadoc9addmods=-Dthis.is.a.dummy=true',
'-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
'-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
'-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
'-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
'-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
'-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
'-Djava9addopens6=-Dthis.is.a.dummy=true',
'-Djava.locale.providers=JRE,CLDR'],
skipcigame: true
],
[ name: 'POI-DSL-1.12', jdk: '1.12', trigger: '''
# do not run this via a schedule for now
''',
// Nodes beam* do not yet have JDK 12 installed
slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam6&&!beam7&&!beam8&&!beam9&&!beam10&&!beam11&&!beam12&&!beam13&&!beam14&&!beam15&&!beam16',
properties: ['-Djava9addmods=-Dthis.is.a.dummy=true',
'-Djavadoc9addmods=-Dthis.is.a.dummy=true',
'-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
'-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
'-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
'-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
'-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
'-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
'-Djava9addopens6=-Dthis.is.a.dummy=true',
'-Djava.locale.providers=JRE,CLDR'],
skipcigame: true
],
[ name: 'POI-DSL-IBM-JDK', jdk: 'IBMJDK', trigger: triggerSundays,
// some OOXML tests fail with strange XML parsing errors and missing JCE unlimited strength requirements
disabled: true, skipcigame: true
],
[ name: 'POI-DSL-old-Xerces', trigger: triggerSundays,
shell: "mkdir -p compile-lib && test -f ${xercesLib} || wget -O ${xercesLib} ${xercesUrl}\n",
// the property triggers using Xerces as XML Parser and previously showed some exception that can occur
properties: ["-Dadditionaljar=${xercesLib}"]
],
[ name: 'POI-DSL-Maven', trigger: 'H */4 * * *', maven: true
],
[ name: 'POI-DSL-regenerate-javadoc', trigger: triggerSundays, javadoc: true
],
// disabled for 4.0.0 because we break compatibility on-purpose in a few places, e.g. for Java 9 compatibility
[ name: 'POI-DSL-API-Check', trigger: '@daily', apicheck: true, disabled: true
],
[ name: 'POI-DSL-Gradle', 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
addShell: 'touch --no-create build/*/build/test-results/TEST-*.xml build/*/build/test-results/test/TEST-*.xml'
],
[ name: 'POI-DSL-no-scratchpad', trigger: triggerSundays, noScratchpad: true
],
[ name: 'POI-DSL-SonarQube', trigger: 'H 9 * * *', maven: true, sonar: true, skipcigame: true
],
[ name: 'POI-DSL-SonarQube-Gradle', trigger: 'H 9 * * *', gradle: true, sonar: true, skipcigame: true,
disabled: true // this one does run, but does not actually send data to Sonarqube for some reason, we need to investigate some more
],
[ name: 'POI-DSL-Windows-1.8', trigger: 'H */12 * * *', windows: true, slaves: 'Windows'
],
]
def svnBase = 'https://svn.apache.org/repos/asf/poi/trunk'
def defaultJdk = '1.8'
def defaultTrigger = 'H/15 * * * *' // check SCM every 60/15 = 4 minutes
def defaultEmail = 'dev@poi.apache.org'
def defaultAnt = 'Ant 1.9.9'
// currently a lot of H?? slaves don't have Ant installed ... H21 seems to have a SVN problem
def defaultSlaves = '(ubuntu||beam)&&!cloud-slave&&!H15&&!H17&&!H18&&!H24&&!ubuntu-4&&!H21'
def jdkMapping = [
'1.8': 'JDK 1.8 (latest)',
'1.9': 'JDK 1.9 (latest)',
'1.10': 'JDK 10 (latest)',
'1.11': 'JDK 11 (latest)',
'1.12': 'JDK 12 (latest)',
'OpenJDK': 'OpenJDK 8 (on Ubuntu only) ', // blank is required here until the name in the Jenkins instance is fixed!
'IBMJDK': 'IBM 1.8 64-bit (on Ubuntu only)',
]
static def shellEx(def context, String cmd, def poijob) {
if (poijob.windows) {
context.batchFile(cmd)
} else {
context.shell(cmd)
}
}
def defaultDesc = '''
Apache POI - the Java API for Microsoft Documents
This is an automatically generated Job Config, do not edit it here! Instead change the Jenkins Job DSL at https://svn.apache.org/repos/asf/poi/trunk/jenkins, see https://github.com/jenkinsci/job-dsl-plugin/wiki for more details about the DSL.
''' def apicheckDesc = '''API Check POI API Check POI-OOXML API Check POI-Excelant API Check POI-Scratchpad
''' def sonarDesc = '''Findbugs report of latest build - Sonar reports - Coverage of latest build
''' def shellCmdsUnix = '''# show which files are currently modified in the working copy svn status # print out information about which exact version of java we are using echo Java-Home: $JAVA_HOME ls -al $JAVA_HOME/ ls -al $JAVA_HOME/bin $JAVA_HOME/bin/java -version echo which java which java java -version echo which javac which javac javac -version echo '