Add Jenkins DSL for JDK 9, Maven, regenerate-javadoc, API-Check, Gradle, no-scratchpad and old-xerces
Adjust script and refactor to reuse more stuff Add a workaround for properties git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1772263 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d4663ea956
commit
9a3332b146
@ -1,16 +1,12 @@
|
|||||||
// You can use http://job-dsl.herokuapp.com/ to validate the code before checkin
|
// You can use http://job-dsl.herokuapp.com/ to validate the code before checkin
|
||||||
//
|
//
|
||||||
|
|
||||||
// Missing configs:
|
// POI-JDK-IBM: This config was not enabled in Jenkins ever because we did not find the JDK on any of the slaves, we can check this again later
|
||||||
//
|
|
||||||
// POI-JDK-IBM: Disabled, did not find the JDK on any of the slaves, need to check this again later
|
|
||||||
|
|
||||||
/* Missing configs:
|
def triggerSundays = '''
|
||||||
Erfolgreich 20% Build planen für POI-API-Check
|
# only run this once per week on Sundays
|
||||||
Erfolgreich 100% Build planen für POI-Gradle
|
H H * * 0
|
||||||
Erfolgreich 100% Build planen für POI-Maven
|
'''
|
||||||
Erfolgreich 100% Build planen für POI-regenerate-javadoc
|
|
||||||
*/
|
|
||||||
|
|
||||||
def poijobs = [
|
def poijobs = [
|
||||||
[
|
[
|
||||||
@ -27,40 +23,55 @@ def poijobs = [
|
|||||||
jdks: ["OpenJDK"],
|
jdks: ["OpenJDK"],
|
||||||
trigger: 'H */12 * * *'
|
trigger: 'H */12 * * *'
|
||||||
],
|
],
|
||||||
/* Properties do not work?!
|
|
||||||
[
|
[
|
||||||
name: 'POI-DSL-1.9',
|
name: 'POI-DSL-1.9',
|
||||||
jdks: ["1.9"],
|
jdks: ["1.9"],
|
||||||
trigger: '# only run this once per week on Sundays\n' +
|
trigger: triggerSundays,
|
||||||
'H H * * 0',
|
properties: ['-Dmaxpermsize=-Dthis.is.a.dummy=true', '-Djava9addmods=-addmods', '-Djava9addmodsvalue=java.xml.bind', '-Djava.locale.providers=JRE,CLDR'],
|
||||||
properties: 'maxpermsize=-Dthis.is.a.dummy=true\n' +
|
|
||||||
'java9addmods=-addmods\n' +
|
|
||||||
'java9addmodsvalue=java.xml.bind\n' +
|
|
||||||
'java.locale.providers=JRE,CLDR',
|
|
||||||
email: 'centic@apache.org'
|
email: 'centic@apache.org'
|
||||||
],*/
|
],
|
||||||
/* Properties do not work?!
|
|
||||||
[
|
[
|
||||||
name: 'POI-DSL-old-Xerces',
|
name: 'POI-DSL-old-Xerces',
|
||||||
jdks: ["1.9"],
|
jdks: ["1.9"],
|
||||||
trigger: '# only run this once per week on Sundays\n' +
|
trigger: triggerSundays,
|
||||||
'H H * * 0',
|
shell: 'mkdir -p compile-lib && test -f compile-lib/xercesImpl-2.6.1.jar || wget -O compile-lib/xercesImpl-2.6.1.jar http://repo1.maven.org/maven2/xerces/xercesImpl/2.6.1/xercesImpl-2.6.1.jar\n',
|
||||||
shell: 'mkdir -p compile-lib && test -f compile-lib/xercesImpl-2.6.1.jar || wget -O compile-lib/xercesImpl-2.6.1.jar http://repo1.maven.org/maven2/xerces/xercesImpl/2.6.1/xercesImpl-2.6.1.jar\n',
|
// the property triggers using Xerces as XML Parser and previously showed some exception that can occur
|
||||||
properties: '# this triggers using Xerces as XML Parser and previously showed some exception that can occur\n' +
|
properties: ['-Dadditionaljar=compile-lib/xercesImpl-2.6.1.jar']
|
||||||
'additionaljar=compile-lib/xercesImpl-2.6.1.jar'
|
],
|
||||||
],*/
|
|
||||||
/* Not finished yet
|
|
||||||
[
|
[
|
||||||
name: 'POI-DSL-no-scratchpad',
|
name: 'POI-DSL-Maven',
|
||||||
trigger: '# only run this once per week on Sundays\n' +
|
trigger: 'H */4 * * *',
|
||||||
'H H * * 0',
|
maven: true
|
||||||
],*/
|
],
|
||||||
|
[
|
||||||
|
name: 'POI-DSL-regenerate-javadoc',
|
||||||
|
trigger: triggerSundays,
|
||||||
|
javadoc: true
|
||||||
|
],
|
||||||
|
[
|
||||||
|
name: 'POI-DSL-API-Check',
|
||||||
|
trigger: '@daily',
|
||||||
|
apicheck: true
|
||||||
|
],
|
||||||
|
[
|
||||||
|
name: 'POI-DSL-Gradle',
|
||||||
|
jdks: ["1.7"],
|
||||||
|
trigger: triggerSundays,
|
||||||
|
email: 'centic@apache.org',
|
||||||
|
gradle: true
|
||||||
|
],
|
||||||
|
[
|
||||||
|
name: 'POI-DSL-no-scratchpad',
|
||||||
|
trigger: triggerSundays,
|
||||||
|
noScratchpad: 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 defaultJdks = ["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 jdkMapping = [
|
def jdkMapping = [
|
||||||
"1.6": "JDK 1.6 (latest)",
|
"1.6": "JDK 1.6 (latest)",
|
||||||
@ -71,104 +82,196 @@ def jdkMapping = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
poijobs.each { poijob ->
|
poijobs.each { poijob ->
|
||||||
|
|
||||||
def jdks = poijob.jdks ?: defaultJdks
|
def jdks = poijob.jdks ?: defaultJdks
|
||||||
def trigger = poijob.trigger ?: defaultTrigger
|
def trigger = poijob.trigger ?: defaultTrigger
|
||||||
def email = poijob.email ?: defaultEmail
|
def email = poijob.email ?: defaultEmail
|
||||||
|
|
||||||
jdks.each { jdkKey ->
|
jdks.each { jdkKey ->
|
||||||
job(poijob.name) {
|
job(poijob.name) {
|
||||||
// for now we create the jobs in disabled state so they do not run for now
|
// for now we create the jobs in disabled state so they do not run for now
|
||||||
disabled()
|
disabled()
|
||||||
|
|
||||||
description('<img src="http://poi.apache.org/resources/images/project-logo.jpg" />\n' +
|
description('''
|
||||||
'<p>\n' +
|
<img src="http://poi.apache.org/resources/images/project-logo.jpg" />
|
||||||
'Apache POI - the Java API for Microsoft Documents\n' +
|
<p>
|
||||||
'</p>\n' +
|
Apache POI - the Java API for Microsoft Documents
|
||||||
'<p>\n' +
|
</p>
|
||||||
' <b>This is an automatically generated Job Config, do not edit it here!\n' +
|
<p>
|
||||||
' 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>,\n' +
|
<b>This is an automatically generated Job Config, do not edit it here!
|
||||||
' see <a href="https://github.com/jenkinsci/job-dsl-plugin/wiki">https://github.com/jenkinsci/job-dsl-plugin/wiki</a>\n' +
|
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>,
|
||||||
' for more details about the DSL.</b>\n' +
|
see <a href="https://github.com/jenkinsci/job-dsl-plugin/wiki">https://github.com/jenkinsci/job-dsl-plugin/wiki</a>
|
||||||
'</p>\n' +
|
for more details about the DSL.</b>
|
||||||
'<p>\n' +
|
</p>
|
||||||
' <b><a href="lastSuccessfulBuild/findbugsResult/" target="_blank">Findbugs report of latest build</a></b> -\n' +
|
<p>
|
||||||
' <b><a href="https://analysis.apache.org/dashboard/index/221489" target="_blank">Sonar reports</a></b> -\n' +
|
<b><a href="lastSuccessfulBuild/findbugsResult/" target="_blank">Findbugs report of latest build</a></b> -
|
||||||
' <b><a href="lastSuccessfulBuild/artifact/build/coverage/index.html" target="_blank">Coverage of latest build</a></b>\n' +
|
<b><a href="https://analysis.apache.org/dashboard/index/221489" target="_blank">Sonar reports</a></b> -
|
||||||
'</p>\n')
|
<b><a href="lastSuccessfulBuild/artifact/build/coverage/index.html" target="_blank">Coverage of latest build</a></b>
|
||||||
logRotator {
|
</p>
|
||||||
numToKeep(5)
|
''')
|
||||||
artifactNumToKeep(1)
|
logRotator {
|
||||||
}
|
numToKeep(5)
|
||||||
label('ubuntu&&!cloud-slave')
|
artifactNumToKeep(1)
|
||||||
environmentVariables {
|
}
|
||||||
env('LANG', 'en_US.UTF-8')
|
label('ubuntu&&!cloud-slave')
|
||||||
}
|
environmentVariables {
|
||||||
wrappers {
|
env('LANG', 'en_US.UTF-8')
|
||||||
timeout {
|
}
|
||||||
absolute(180)
|
wrappers {
|
||||||
abortBuild()
|
timeout {
|
||||||
writeDescription('Build was aborted due to timeout')
|
absolute(180)
|
||||||
|
abortBuild()
|
||||||
|
writeDescription('Build was aborted due to timeout')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jdk(jdkMapping.get(jdkKey))
|
||||||
|
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\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
|
||||||
|
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 {
|
||||||
|
goals('package')
|
||||||
|
rootPOM('sonar/pom.xml')
|
||||||
|
mavenOpts('-Xmx2g')
|
||||||
|
mavenOpts('-Xms256m')
|
||||||
|
mavenOpts('-XX:MaxPermSize=512m')
|
||||||
|
mavenOpts('-XX:-OmitStackTraceInFastThrow')
|
||||||
|
localRepository(LocalRepositoryLocation.LOCAL_TO_WORKSPACE)
|
||||||
|
mavenInstallation('maven-3.2.1')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
publishers {
|
||||||
|
configure { project ->
|
||||||
|
project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
|
||||||
|
}
|
||||||
|
mailer(email, false, false)
|
||||||
|
}
|
||||||
|
} else if (poijob.javadoc) {
|
||||||
|
steps {
|
||||||
|
shell(shellcmds)
|
||||||
|
ant {
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
shell('zip -r build/javadocs.zip build/tmp/site/build/site/apidocs')
|
||||||
}
|
}
|
||||||
}
|
publishers {
|
||||||
jdk(jdkMapping.get(jdkKey))
|
configure { project ->
|
||||||
scm {
|
project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
|
||||||
svn(svnBase) { svnNode ->
|
}
|
||||||
svnNode / browser(class: 'hudson.scm.browsers.ViewSVN') /
|
mailer(email, false, false)
|
||||||
url << 'http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN'
|
}
|
||||||
}
|
} else if (poijob.apicheck) {
|
||||||
}
|
steps {
|
||||||
triggers {
|
shell(shellcmds)
|
||||||
scm(trigger)
|
gradle {
|
||||||
}
|
tasks('japicmp')
|
||||||
steps {
|
useWrapper(false)
|
||||||
shell('# show which files are currently modified in the working copy\n' +
|
|
||||||
'svn status\n' +
|
|
||||||
'\n' +
|
|
||||||
'echo $JAVA_HOME\n' +
|
|
||||||
'ls -al $JAVA_HOME\n' +
|
|
||||||
'\n' +
|
|
||||||
(poijob.shell ?: '') + '\n' +
|
|
||||||
'# ignore any error message\n' +
|
|
||||||
'exit 0\n')
|
|
||||||
ant {
|
|
||||||
targets(['clean', 'jenkins'])
|
|
||||||
prop('coverage.enabled', true)
|
|
||||||
//properties(poijob.properties ?: '')
|
|
||||||
antInstallation('Ant (latest)')
|
|
||||||
}
|
|
||||||
ant {
|
|
||||||
buildFile('src/integrationtest/build.xml')
|
|
||||||
//properties(poijob.properties ?: '')
|
|
||||||
antInstallation('Ant (latest)')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
publishers {
|
|
||||||
findbugs('build/findbugs.xml', false) {
|
|
||||||
healthLimits(3, 20)
|
|
||||||
thresholdLimit('low')
|
|
||||||
defaultEncoding('UTF-8')
|
|
||||||
}
|
|
||||||
archiveArtifacts('build/dist/*.tar.gz,build/findbugs.html,build/coverage/**,build/integration-test-results/**,ooxml-lib/**')
|
|
||||||
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') {
|
|
||||||
testDataPublishers {
|
|
||||||
publishTestStabilityData()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
jacocoCodeCoverage {
|
publishers {
|
||||||
classPattern('build/classes,build/examples-classes,build/excelant-classes,build/ooxml-classes,build/scratchpad-classes')
|
archiveArtifacts('build/*/build/reports/japi.html')
|
||||||
execPattern('build/*.exec')
|
configure { project ->
|
||||||
sourcePattern('src/java,src/excelant/java,src/ooxml/java,src/scratchpad/src')
|
project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
|
||||||
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')
|
}
|
||||||
}
|
mailer(email, false, false)
|
||||||
configure { project ->
|
}
|
||||||
project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
|
} else {
|
||||||
}
|
steps {
|
||||||
mailer('dev@poi.apache.org', false, false)
|
shell(shellcmds)
|
||||||
}
|
// 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 {
|
||||||
|
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 {
|
||||||
|
findbugs('build/findbugs.xml', false) {
|
||||||
|
healthLimits(3, 20)
|
||||||
|
thresholdLimit('low')
|
||||||
|
defaultEncoding('UTF-8')
|
||||||
|
}
|
||||||
|
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-*.xml') {
|
||||||
|
testDataPublishers {
|
||||||
|
publishTestStabilityData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jacocoCodeCoverage {
|
||||||
|
classPattern('build/classes,build/examples-classes,build/excelant-classes,build/ooxml-classes,build/scratchpad-classes')
|
||||||
|
execPattern('build/*.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')
|
||||||
|
}
|
||||||
|
configure { project ->
|
||||||
|
project / publishers << 'hudson.plugins.cigame.GamePublisher' {}
|
||||||
|
}
|
||||||
|
mailer(email, false, false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user