您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

create_jobs.groovy 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. // This script is used as input to the Jenkins Job DSL plugin to create all the build-jobs that
  2. // Apache POI uses on the public Jenkins instance at https://builds.apache.org/view/P/view/POI/
  3. //
  4. // See https://github.com/jenkinsci/job-dsl-plugin/wiki for information about the DSL, you can
  5. // use http://job-dsl.herokuapp.com/ to validate the code before checkin
  6. //
  7. def triggerSundays = '''
  8. # only run this once per week on Sundays
  9. H H * * 0
  10. '''
  11. def xercesUrl = 'http://repo1.maven.org/maven2/xerces/xercesImpl/2.6.1/xercesImpl-2.6.1.jar'
  12. def xercesLib = 'compile-lib/xercesImpl-2.6.1.jar'
  13. def poijobs = [
  14. [ name: 'POI-DSL-1.8', trigger: 'H */12 * * *'
  15. ],
  16. [ name: 'POI-DSL-OpenJDK', jdk: 'OpenJDK', trigger: 'H */12 * * *',
  17. // H13-H20 (Ubuntu 16.04) do not have OpenJDK 6 installed, see https://issues.apache.org/jira/browse/INFRA-12880
  18. slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam5&&!beam6&&!beam7&&!beam8' +
  19. '&&!H0&&!H1&&!H2&&!H3&&!H4&&!H5&&!H6&&!H7&&!H8&&!H9&&!H10&&!H11' +
  20. '&&!qnode3' +
  21. '&&!ubuntu-1&&!ubuntu-2&&!ubuntu-4&&!ubuntu-5&&!ubuntu-6&&!ubuntu-eu2&&!ubuntu-us1',
  22. // the JDK is missing on some slaves so builds are unstable
  23. skipcigame: true
  24. ],
  25. [ name: 'POI-DSL-1.9', jdk: '1.9', trigger: triggerSundays,
  26. properties: ['-Djava9addmods=--add-modules=java.xml.bind',
  27. '-Djavadoc9addmods=--add-modules=java.xml.bind',
  28. '-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
  29. '-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
  30. '-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
  31. '-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
  32. '-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
  33. '-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
  34. '-Djava9addopens6=--add-opens=java.base/java.lang=java.xml.bind',
  35. '-Djava.locale.providers=JRE,CLDR'],
  36. skipcigame: true
  37. ],
  38. [ name: 'POI-DSL-1.10', jdk: '1.10', trigger: triggerSundays,
  39. properties: ['-Djava9addmods=--add-modules=java.xml.bind',
  40. '-Djavadoc9addmods=--add-modules=java.xml.bind',
  41. '-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
  42. '-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
  43. '-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
  44. '-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
  45. '-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
  46. '-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
  47. '-Djava9addopens6=--add-opens=java.base/java.lang=java.xml.bind',
  48. '-Djava.locale.providers=JRE,CLDR'],
  49. skipcigame: true
  50. ],
  51. [ name: 'POI-DSL-1.11', jdk: '1.11', trigger: triggerSundays,
  52. // Nodes beam* do not yet have JDK 11 installed
  53. slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam6&&!beam7&&!beam8&&!beam9&&!beam10&&!beam11&&!beam12&&!beam13&&!beam14&&!beam15&&!beam16',
  54. properties: ['-Djava9addmods=-Dthis.is.a.dummy=true',
  55. '-Djavadoc9addmods=-Dthis.is.a.dummy=true',
  56. '-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
  57. '-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
  58. '-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
  59. '-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
  60. '-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
  61. '-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
  62. '-Djava9addopens6=-Dthis.is.a.dummy=true',
  63. '-Djava.locale.providers=JRE,CLDR'],
  64. skipcigame: true
  65. ],
  66. [ name: 'POI-DSL-1.12', jdk: '1.12', trigger: '''
  67. # do not run this via a schedule for now
  68. ''',
  69. // Nodes beam* do not yet have JDK 12 installed
  70. slaveAdd: '&&!beam1&&!beam2&&!beam3&&!beam4&&!beam6&&!beam7&&!beam8&&!beam9&&!beam10&&!beam11&&!beam12&&!beam13&&!beam14&&!beam15&&!beam16',
  71. properties: ['-Djava9addmods=-Dthis.is.a.dummy=true',
  72. '-Djavadoc9addmods=-Dthis.is.a.dummy=true',
  73. '-Djava9addmodsvalue=-Dsun.reflect.debugModuleAccessChecks=true',
  74. '-Djava9addopens1=--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED',
  75. '-Djava9addopens2=--add-opens=java.base/java.io=ALL-UNNAMED',
  76. '-Djava9addopens3=--add-opens=java.base/java.nio=ALL-UNNAMED',
  77. '-Djava9addopens4=--add-opens=java.base/java.lang=ALL-UNNAMED',
  78. '-Djava9addopens5=--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
  79. '-Djava9addopens6=-Dthis.is.a.dummy=true',
  80. '-Djava.locale.providers=JRE,CLDR'],
  81. skipcigame: true
  82. ],
  83. [ name: 'POI-DSL-IBM-JDK', jdk: 'IBMJDK', trigger: triggerSundays,
  84. // some OOXML tests fail with strange XML parsing errors and missing JCE unlimited strength requirements
  85. disabled: true, skipcigame: true
  86. ],
  87. [ name: 'POI-DSL-old-Xerces', trigger: triggerSundays,
  88. shell: "mkdir -p compile-lib && test -f ${xercesLib} || wget -O ${xercesLib} ${xercesUrl}\n",
  89. // the property triggers using Xerces as XML Parser and previously showed some exception that can occur
  90. properties: ["-Dadditionaljar=${xercesLib}"]
  91. ],
  92. [ name: 'POI-DSL-Maven', trigger: 'H */4 * * *', maven: true
  93. ],
  94. [ name: 'POI-DSL-regenerate-javadoc', trigger: triggerSundays, javadoc: true
  95. ],
  96. // disabled for 4.0.0 because we break compatibility on-purpose in a few places, e.g. for Java 9 compatibility
  97. [ name: 'POI-DSL-API-Check', trigger: '@daily', apicheck: true, disabled: true
  98. ],
  99. [ name: 'POI-DSL-Gradle', trigger: triggerSundays, email: 'centic@apache.org', gradle: true,
  100. // Gradle will not run any tests if the code is up-to-date, therefore manually mark the files as updated
  101. addShell: 'touch --no-create build/*/build/test-results/TEST-*.xml build/*/build/test-results/test/TEST-*.xml'
  102. ],
  103. [ name: 'POI-DSL-no-scratchpad', trigger: triggerSundays, noScratchpad: true
  104. ],
  105. [ name: 'POI-DSL-SonarQube', trigger: 'H 9 * * *', maven: true, sonar: true, skipcigame: true
  106. ],
  107. [ name: 'POI-DSL-SonarQube-Gradle', trigger: 'H 9 * * *', gradle: true, sonar: true, skipcigame: true,
  108. disabled: true // this one does run, but does not actually send data to Sonarqube for some reason, we need to investigate some more
  109. ],
  110. [ name: 'POI-DSL-Windows-1.8', trigger: 'H */12 * * *', windows: true, slaves: 'Windows'
  111. ],
  112. ]
  113. def svnBase = 'https://svn.apache.org/repos/asf/poi/trunk'
  114. def defaultJdk = '1.8'
  115. def defaultTrigger = 'H/15 * * * *' // check SCM every 60/15 = 4 minutes
  116. def defaultEmail = 'dev@poi.apache.org'
  117. def defaultAnt = 'Ant 1.9.9'
  118. // currently a lot of H?? slaves don't have Ant installed ... H21 seems to have a SVN problem
  119. def defaultSlaves = '(ubuntu||beam)&&!cloud-slave&&!H15&&!H17&&!H18&&!H24&&!ubuntu-4&&!H21'
  120. def jdkMapping = [
  121. '1.8': 'JDK 1.8 (latest)',
  122. '1.9': 'JDK 1.9 (latest)',
  123. '1.10': 'JDK 10 (latest)',
  124. '1.11': 'JDK 11 (latest)',
  125. '1.12': 'JDK 12 (latest)',
  126. 'OpenJDK': 'OpenJDK 8 (on Ubuntu only) ', // blank is required here until the name in the Jenkins instance is fixed!
  127. 'IBMJDK': 'IBM 1.8 64-bit (on Ubuntu only)',
  128. ]
  129. static def shellEx(def context, String cmd, def poijob) {
  130. if (poijob.windows) {
  131. context.batchFile(cmd)
  132. } else {
  133. context.shell(cmd)
  134. }
  135. }
  136. def defaultDesc = '''
  137. <img src="https://poi.apache.org/resources/images/project-logo.jpg" />
  138. <p>
  139. Apache POI - the Java API for Microsoft Documents
  140. </p>
  141. <p>
  142. <b>This is an automatically generated Job Config, do not edit it here!
  143. Instead change the Jenkins Job DSL at <a href="https://svn.apache.org/repos/asf/poi/trunk/jenkins">https://svn.apache.org/repos/asf/poi/trunk/jenkins</a>,
  144. see <a href="https://github.com/jenkinsci/job-dsl-plugin/wiki">https://github.com/jenkinsci/job-dsl-plugin/wiki</a>
  145. for more details about the DSL.</b>
  146. </p>'''
  147. def apicheckDesc = '''
  148. <p>
  149. <b><a href="https://builds.apache.org/analysis/dashboard?id=org.apache.poi%3Apoi-parent&did=1" target="_blank">Sonar reports</a></b> -
  150. <p>
  151. <b><a href="lastSuccessfulBuild/artifact/build/main/build/reports/japi.html">API Check POI</a></b>
  152. <b><a href="lastSuccessfulBuild/artifact/build/ooxml/build/reports/japi.html">API Check POI-OOXML</a></b>
  153. <b><a href="lastSuccessfulBuild/artifact/build/excelant/build/reports/japi.html">API Check POI-Excelant</a></b>
  154. <b><a href="lastSuccessfulBuild/artifact/build/scratchpad/build/reports/japi.html">API Check POI-Scratchpad</a></b>
  155. </p>
  156. '''
  157. def sonarDesc = '''
  158. <p>
  159. <b><a href="lastSuccessfulBuild/findbugsResult/" target="_blank">Findbugs report of latest build</a></b> -
  160. <b><a href="https://builds.apache.org/analysis/dashboard?id=org.apache.poi%3Apoi-parent&did=1" target="_blank">Sonar reports</a></b> -
  161. <b><a href="lastSuccessfulBuild/artifact/build/coverage/index.html" target="_blank">Coverage of latest build</a></b>
  162. </p>
  163. '''
  164. def shellCmdsUnix =
  165. '''# show which files are currently modified in the working copy
  166. svn status
  167. # print out information about which exact version of java we are using
  168. echo Java-Home: $JAVA_HOME
  169. ls -al $JAVA_HOME/
  170. ls -al $JAVA_HOME/bin
  171. $JAVA_HOME/bin/java -version
  172. echo which java
  173. which java
  174. java -version
  175. echo which javac
  176. which javac
  177. javac -version
  178. echo '<project default="test"><target name="test"><echo>Java ${ant.java.version}/${java.version}</echo><exec executable="javac"><arg value="-version"/></exec></target></project>' > build.javacheck.xml
  179. ant -f build.javacheck.xml -v
  180. POIJOBSHELL
  181. # ignore any error message
  182. exit 0'''
  183. def shellCmdsWin =
  184. '''@echo off
  185. :: show which files are currently modified in the working copy
  186. svn status
  187. :: print out information about which exact version of java we are using
  188. echo Java-Home: %JAVA_HOME%
  189. dir "%JAVA_HOME:\\\\=\\%"
  190. "%JAVA_HOME%/bin/java" -version
  191. POIJOBSHELL
  192. :: ignore any error message
  193. exit /b 0'''
  194. poijobs.each { poijob ->
  195. def jdkKey = poijob.jdk ?: defaultJdk
  196. def trigger = poijob.trigger ?: defaultTrigger
  197. def email = poijob.email ?: defaultEmail
  198. def slaves = poijob.slaves ?: defaultSlaves + (poijob.slaveAdd ?: '')
  199. def antRT = defaultAnt + (poijob.windows ? ' (Windows)' : '')
  200. job(poijob.name) {
  201. if (poijob.disabled) {
  202. disabled()
  203. }
  204. description( defaultDesc + (poijob.apicheck ? apicheckDesc : sonarDesc) )
  205. logRotator {
  206. numToKeep(5)
  207. artifactNumToKeep(1)
  208. }
  209. label(slaves)
  210. environmentVariables {
  211. env('LANG', 'en_US.UTF-8')
  212. if(jdkKey == '1.9' || jdkKey == '1.10') {
  213. // when using JDK 9/10 for running Ant, we need to provide more modules for the forbidden-api-checks task
  214. // on JDK 11 and newer there is no such module any more, so do not add it here
  215. env('ANT_OPTS', '--add-modules=java.xml.bind --add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED')
  216. }
  217. env('FORREST_HOME', poijob.windows ? 'f:\\jenkins\\tools\\forrest\\latest' : '/home/jenkins/tools/forrest/latest')
  218. }
  219. wrappers {
  220. timeout {
  221. absolute(180)
  222. abortBuild()
  223. writeDescription('Build was aborted due to timeout')
  224. }
  225. preBuildCleanup {
  226. includePattern('**/ooxml-lib/ooxml*.jar')
  227. }
  228. if(poijob.sonar) {
  229. configure { project ->
  230. project / buildWrappers << 'hudson.plugins.sonar.SonarBuildWrapper' {}
  231. }
  232. }
  233. }
  234. jdk(jdkMapping.get(jdkKey))
  235. scm {
  236. svn(svnBase) { svnNode ->
  237. svnNode / browser(class: 'hudson.scm.browsers.ViewSVN') /
  238. url << 'http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN'
  239. }
  240. }
  241. checkoutRetryCount(3)
  242. triggers {
  243. scm(trigger)
  244. }
  245. def shellcmds = (poijob.windows ? shellCmdsWin : shellCmdsUnix).replace('POIJOBSHELL', poijob.shell ?: '')
  246. // Create steps and publishers depending on the type of Job that is selected
  247. if(poijob.maven) {
  248. steps {
  249. shellEx(delegate, shellcmds, poijob)
  250. maven {
  251. goals('clean')
  252. rootPOM('sonar/pom.xml')
  253. localRepository(LocalRepositoryLocation.LOCAL_TO_WORKSPACE)
  254. mavenInstallation('maven-3.2.1')
  255. }
  256. /* Currently not done, let's see if it is still necessary:
  257. # Maven-Download fails for strange reasons, try to workaround...
  258. 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
  259. */
  260. maven {
  261. if(poijob.sonar) {
  262. goals('compile $SONAR_MAVEN_GOAL -Dsonar.host.url=$SONAR_HOST_URL')
  263. } else {
  264. goals('package')
  265. }
  266. rootPOM('sonar/pom.xml')
  267. mavenOpts('-Xmx2g')
  268. mavenOpts('-Xms256m')
  269. mavenOpts('-XX:-OmitStackTraceInFastThrow')
  270. localRepository(LocalRepositoryLocation.LOCAL_TO_WORKSPACE)
  271. mavenInstallation('maven-3.2.1')
  272. }
  273. }
  274. publishers {
  275. if (!poijob.skipcigame) {
  276. configure { project ->
  277. project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
  278. }
  279. }
  280. if (!poijob.sonar) {
  281. archiveJunit('sonar/*/target/surefire-reports/TEST-*.xml') {
  282. testDataPublishers {
  283. publishTestStabilityData()
  284. }
  285. }
  286. }
  287. mailer(email, false, false)
  288. }
  289. } else if (poijob.javadoc) {
  290. steps {
  291. shellEx(delegate, shellcmds, poijob)
  292. ant {
  293. targets(['clean', 'javadocs'] + (poijob.properties ?: []))
  294. prop('coverage.enabled', true)
  295. // Properties did not work, so I had to use targets instead
  296. //properties(poijob.properties ?: '')
  297. antInstallation(antRT)
  298. }
  299. shellEx(delegate, 'zip -r build/javadocs.zip build/site/apidocs', poijob)
  300. }
  301. publishers {
  302. if (!poijob.skipcigame) {
  303. configure { project ->
  304. project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
  305. }
  306. }
  307. mailer(email, false, false)
  308. }
  309. } else if (poijob.apicheck) {
  310. steps {
  311. shellEx(delegate, shellcmds, poijob)
  312. gradle {
  313. tasks('japicmp')
  314. useWrapper(false)
  315. }
  316. }
  317. publishers {
  318. archiveArtifacts('build/*/build/reports/japi.html')
  319. if (!poijob.skipcigame) {
  320. configure { project ->
  321. project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
  322. }
  323. }
  324. mailer(email, false, false)
  325. }
  326. } else if(poijob.sonar) {
  327. steps {
  328. shellEx(delegate, shellcmds, poijob)
  329. gradle {
  330. switches('-PenableSonar')
  331. switches('-Dsonar.host.url=$SONAR_HOST_URL')
  332. tasks('sonarqube')
  333. useWrapper(false)
  334. }
  335. }
  336. publishers {
  337. if (!poijob.skipcigame) {
  338. configure { project ->
  339. project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
  340. }
  341. }
  342. mailer(email, false, false)
  343. }
  344. } else {
  345. steps {
  346. shellEx(delegate, shellcmds, poijob)
  347. if(poijob.addShell) {
  348. shellEx(delegate, poijob.addShell, poijob)
  349. }
  350. // For Jobs that should still have the default set of publishers we can configure different steps here
  351. if(poijob.gradle) {
  352. gradle {
  353. tasks('check')
  354. useWrapper(false)
  355. }
  356. } else if (poijob.noScratchpad) {
  357. ant {
  358. targets(['clean', 'compile-all'] + (poijob.properties ?: []))
  359. prop('coverage.enabled', true)
  360. antInstallation(antRT)
  361. }
  362. ant {
  363. targets(['-Dscratchpad.ignore=true', 'jacocotask', 'test-all', 'testcoveragereport'] + (poijob.properties ?: []))
  364. prop('coverage.enabled', true)
  365. antInstallation(antRT)
  366. }
  367. } else {
  368. ant {
  369. targets(['clean', 'jenkins'] + (poijob.properties ?: []))
  370. prop('coverage.enabled', true)
  371. // Properties did not work, so I had to use targets instead
  372. //properties(poijob.properties ?: '')
  373. antInstallation(antRT)
  374. }
  375. ant {
  376. targets(['run'] + (poijob.properties ?: []))
  377. buildFile('src/integrationtest/build.xml')
  378. // Properties did not work, so I had to use targets instead
  379. //properties(poijob.properties ?: '')
  380. antInstallation(antRT)
  381. }
  382. }
  383. }
  384. publishers {
  385. findbugs('build/findbugs.xml', false) {
  386. healthLimits(3, 20)
  387. thresholdLimit('low')
  388. defaultEncoding('UTF-8')
  389. }
  390. // in archive, junit and jacoco publishers, matches beneath build/*/build/... are for Gradle-build results
  391. archiveArtifacts('build/dist/*.tar.gz,build/findbugs.html,build/coverage/**,build/integration-test-results/**,ooxml-lib/**,build/*/build/libs/*.jar')
  392. warnings(['Java Compiler (javac)', 'JavaDoc Tool'], null) {
  393. resolveRelativePaths()
  394. }
  395. 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,build/*/build/test-results/TEST-*.xml') {
  396. testDataPublishers {
  397. publishTestStabilityData()
  398. }
  399. }
  400. jacocoCodeCoverage {
  401. classPattern('build/classes,build/excelant-classes,build/ooxml-classes,build/scratchpad-classes,build/*/build/classes')
  402. execPattern('build/*.exec,build/*/build/jacoco/*.exec')
  403. sourcePattern('src/java,src/excelant/java,src/ooxml/java,src/scratchpad/src')
  404. 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')
  405. }
  406. if (!poijob.skipcigame) {
  407. configure { project ->
  408. project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
  409. }
  410. }
  411. mailer(email, false, false)
  412. }
  413. }
  414. }
  415. }
  416. /*
  417. Add a special job which spans a two-dimensional matrix of all JDKs that we want to use and
  418. all slaves that we would like to use and test if the java and ant binaries are available
  419. on that machine correctly.
  420. */
  421. matrixJob('POI-DSL-Test-Environment') {
  422. description(
  423. '''
  424. Check installed version of Java/Ant on all build-nodes
  425. This job is used to verify which machines actually have the required programs installed.
  426. Unfortunately we often see builds break because of changes/new machines...'''
  427. )
  428. /*throttleConcurrentBuilds {
  429. maxPerNode(1)
  430. maxTotal(1)
  431. }*/
  432. logRotator {
  433. numToKeep(5)
  434. artifactNumToKeep(1)
  435. }
  436. axes {
  437. jdk(
  438. 'JDK 1.8 (latest)',
  439. 'OpenJDK 8 (on Ubuntu only) ', // blank is required here until the name in the Jenkins instance is fixed!
  440. 'IBM 1.8 64-bit (on Ubuntu only)',
  441. 'JDK 1.9 (latest)',
  442. 'JDK 10 (latest)',
  443. 'JDK 10 b46 (Windows Only)',
  444. 'OpenJDK 10.0.2 (on Ubuntu only)',
  445. 'JDK 11 (latest)',
  446. 'JDK 11 b23 (early access build) (Windows Only)',
  447. 'JDK 12 (latest)',
  448. 'JDK 12 b8 (early access build) (Windows Only)'
  449. )
  450. label('Nodes',
  451. 'arm1',
  452. 'beam1','beam2','beam3','beam4','beam5','beam6','beam7','beam8','beam9',
  453. 'beam10','beam11','beam12','beam13','beam14','beam15','beam16',
  454. 'H0','H1','H10','H11','H12','H13','H14','H15','H16','H17','H18','H19',
  455. 'H2','H20','H21','H22','H23','H24','H25','H26','H27','H28','H29',
  456. 'H3','H30','H31','H32','H33','H34','H35',
  457. 'H4','H5','H6','H7','H8','H9',
  458. 'ubuntu-1','ubuntu-2','ubuntu-4','ubuntu-6','ubuntu-eu2','ubuntu-eu3','ubuntu-ppc64le','ubuntu-us1',
  459. 'windows-2012-1','windows-2012-2','windows-2012-3','windows-2016-1','windows-2016-2','windows-2016-3'
  460. )
  461. }
  462. steps {
  463. /*if (poijob.windows) {
  464. context.batchFile(cmd)
  465. } else {*/
  466. shell('''
  467. which javac
  468. javac -version
  469. echo '<?xml version="1.0"?><project name="POI Build" default="test"><target name="test"><echo>Using Ant: ${ant.version} from ${ant.home}</echo></target></project>' > build.xml
  470. ''')
  471. //}
  472. ant {
  473. antInstallation(defaultAnt)
  474. }
  475. }
  476. publishers {
  477. mailer('centic@poi.apache.org' /* defaultEmail */, false, false)
  478. }
  479. }
  480. /* I tried to put the view into a sub-folder/sub-view, but failed, there are multiple related
  481. plugins so this is all a bit confusing :(, see also https://issues.apache.org/jira/browse/INFRA-14002
  482. dashboardView("P/POI-new") {
  483. columns {
  484. status()
  485. weather()
  486. configureProject()
  487. buildButton()
  488. cronTrigger()
  489. lastBuildConsole()
  490. name()
  491. lastSuccess()
  492. lastFailure()
  493. lastDuration()
  494. //lastSuccessDescription()
  495. jacoco()
  496. }
  497. description("Jobs related to building/testing Apache POI")
  498. filterBuildQueue(false)
  499. filterExecutors(false)
  500. // Job selection
  501. jobs {*/
  502. //regex(/.*POI.*/)
  503. /*}
  504. // Layout
  505. topPortlets {
  506. jenkinsJobsList {
  507. displayName('POI jobs')
  508. }
  509. }
  510. leftPortlets {
  511. testStatisticsChart()
  512. }
  513. rightPortlets {
  514. testTrendChart()
  515. }
  516. bottomPortlets {
  517. testStatisticsGrid()
  518. buildStatistics()
  519. }
  520. }*/