Job DSL fix windows call / retrieve findbugs via powershell
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803559 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
18053658cc
commit
d24e0da38a
@ -65,11 +65,14 @@ def poijobs = [
|
|||||||
],
|
],
|
||||||
[ name: 'POI-DSL-SonarQube-Gradle', jdk: '1.8', trigger: 'H 9 * * *', gradle: true, sonar: true, skipcigame: true
|
[ name: 'POI-DSL-SonarQube-Gradle', jdk: '1.8', trigger: 'H 9 * * *', gradle: true, sonar: true, skipcigame: true
|
||||||
],
|
],
|
||||||
[ name: 'POI-DSL-Windows-1.6', jdk: '1.6', trigger: 'H */12 * * *', skipcigame: true, windows: true, slaves: 'Windows', email: 'kiwiwings@apache.org'
|
[ name: 'POI-DSL-Windows-1.6', jdk: '1.6', trigger: 'H */12 * * *', skipcigame: true, windows: true, slaves: 'Windows', email: 'kiwiwings@apache.org',
|
||||||
|
addShell: 'if not exist lib/findbugs-noUpdateChecks-2.0.3.zip powershell -Command wget -Uri "http://downloads.sourceforge.net/project/findbugs/findbugs/2.0.3/findbugs-noUpdateChecks-2.0.3.zip?download=" -OutFile lib/findbugs-noUpdateChecks-2.0.3.zip -UserAgent [Microsoft.PowerShell.Commands.PSUsergAgent]::Chrome'
|
||||||
],
|
],
|
||||||
[ name: 'POI-DSL-Windows-1.7', jdk: '1.7', trigger: 'H */12 * * *', skipcigame: true, windows: true, slaves: 'Windows', email: 'kiwiwings@apache.org'
|
[ name: 'POI-DSL-Windows-1.7', jdk: '1.7', trigger: 'H */12 * * *', skipcigame: true, windows: true, slaves: 'Windows',
|
||||||
|
disabled: true
|
||||||
],
|
],
|
||||||
[ name: 'POI-DSL-Windows-1.8', jdk: '1.8', trigger: 'H */12 * * *', skipcigame: true, windows: true, slaves: 'Windows', email: 'kiwiwings@apache.org'
|
[ name: 'POI-DSL-Windows-1.8', jdk: '1.8', trigger: 'H */12 * * *', skipcigame: true, windows: true, slaves: 'Windows',
|
||||||
|
disabled: true
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -90,6 +93,14 @@ def jdkMapping = [
|
|||||||
'IBMJDK': 'IBM 1.8 64-bit (on Ubuntu only)',
|
'IBMJDK': 'IBM 1.8 64-bit (on Ubuntu only)',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def shellEx(def context, String cmd, def poijob) {
|
||||||
|
if (poijob.windows) {
|
||||||
|
context.batchFile(cmd)
|
||||||
|
} else {
|
||||||
|
context.shell(cmd)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
poijobs.each { poijob ->
|
poijobs.each { poijob ->
|
||||||
def jdkKey = poijob.jdk ?: defaultJdk
|
def jdkKey = poijob.jdk ?: defaultJdk
|
||||||
def trigger = poijob.trigger ?: defaultTrigger
|
def trigger = poijob.trigger ?: defaultTrigger
|
||||||
@ -169,22 +180,38 @@ for more details about the DSL.</b>
|
|||||||
scm(trigger)
|
scm(trigger)
|
||||||
}
|
}
|
||||||
|
|
||||||
def shellcmds = '# show which files are currently modified in the working copy\n' +
|
def shellCmdsUnix =
|
||||||
'svn status\n' +
|
'''# show which files are currently modified in the working copy
|
||||||
'\n' +
|
svn status
|
||||||
'# print out information about which exact version of java we are using\n' +
|
|
||||||
'echo Java-Home: $JAVA_HOME\n' +
|
# print out information about which exact version of java we are using
|
||||||
'ls -al $JAVA_HOME/\n' +
|
echo Java-Home: $JAVA_HOME
|
||||||
'$JAVA_HOME/bin/java -version\n' +
|
ls -al $JAVA_HOME/
|
||||||
'\n' +
|
$JAVA_HOME/bin/java -version
|
||||||
(poijob.shell ?: '') + '\n' +
|
'''+(poijob.shell ?: '')+
|
||||||
'# ignore any error message\n' +
|
'''# ignore any error message
|
||||||
'exit 0\n'
|
exit 0'''
|
||||||
|
|
||||||
|
def shellCmdsWin =
|
||||||
|
'''@echo off
|
||||||
|
:: 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%
|
||||||
|
dir "%JAVA_HOME%"
|
||||||
|
"%JAVA_HOME%/bin/java" -version
|
||||||
|
'''+(poijob.shell ?: '')+
|
||||||
|
'''
|
||||||
|
:: ignore any error message
|
||||||
|
exit 0'''
|
||||||
|
|
||||||
|
def shellcmds = (poijob.windows) ? shellCmdsWin : shellCmdsUnix
|
||||||
|
|
||||||
// Create steps and publishers depending on the type of Job that is selected
|
// Create steps and publishers depending on the type of Job that is selected
|
||||||
if(poijob.maven) {
|
if(poijob.maven) {
|
||||||
steps {
|
steps {
|
||||||
shell(shellcmds)
|
shellEx(delegate, shellcmds, poijob)
|
||||||
maven {
|
maven {
|
||||||
goals('clean')
|
goals('clean')
|
||||||
rootPOM('sonar/pom.xml')
|
rootPOM('sonar/pom.xml')
|
||||||
@ -220,7 +247,7 @@ for more details about the DSL.</b>
|
|||||||
}
|
}
|
||||||
} else if (poijob.javadoc) {
|
} else if (poijob.javadoc) {
|
||||||
steps {
|
steps {
|
||||||
shell(shellcmds)
|
shellEx(delegate, shellcmds, poijob)
|
||||||
ant {
|
ant {
|
||||||
targets(['clean', 'javadocs'] + (poijob.properties ?: []))
|
targets(['clean', 'javadocs'] + (poijob.properties ?: []))
|
||||||
prop('coverage.enabled', true)
|
prop('coverage.enabled', true)
|
||||||
@ -228,7 +255,7 @@ for more details about the DSL.</b>
|
|||||||
//properties(poijob.properties ?: '')
|
//properties(poijob.properties ?: '')
|
||||||
antInstallation(antRT)
|
antInstallation(antRT)
|
||||||
}
|
}
|
||||||
shell('zip -r build/javadocs.zip build/tmp/site/build/site/apidocs')
|
shellEx(delegate, 'zip -r build/javadocs.zip build/tmp/site/build/site/apidocs', poijob)
|
||||||
}
|
}
|
||||||
publishers {
|
publishers {
|
||||||
if (!poijob.skipcigame) {
|
if (!poijob.skipcigame) {
|
||||||
@ -240,7 +267,7 @@ for more details about the DSL.</b>
|
|||||||
}
|
}
|
||||||
} else if (poijob.apicheck) {
|
} else if (poijob.apicheck) {
|
||||||
steps {
|
steps {
|
||||||
shell(shellcmds)
|
shellEx(delegate, shellcmds, poijob)
|
||||||
gradle {
|
gradle {
|
||||||
tasks('japicmp')
|
tasks('japicmp')
|
||||||
useWrapper(false)
|
useWrapper(false)
|
||||||
@ -257,7 +284,7 @@ for more details about the DSL.</b>
|
|||||||
}
|
}
|
||||||
} else if(poijob.sonar) {
|
} else if(poijob.sonar) {
|
||||||
steps {
|
steps {
|
||||||
shell(shellcmds)
|
shellEx(delegate, shellcmds, poijob)
|
||||||
gradle {
|
gradle {
|
||||||
switches('-PenableSonar')
|
switches('-PenableSonar')
|
||||||
switches('-Dsonar.host.url=$SONAR_HOST_URL')
|
switches('-Dsonar.host.url=$SONAR_HOST_URL')
|
||||||
@ -275,9 +302,9 @@ for more details about the DSL.</b>
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
steps {
|
steps {
|
||||||
shell(shellcmds)
|
shellEx(delegate, shellcmds, poijob)
|
||||||
if(poijob.addShell) {
|
if(poijob.addShell) {
|
||||||
shell(poijob.addShell)
|
shellEx(delegate, poijob.addShell, poijob)
|
||||||
}
|
}
|
||||||
// For Jobs that should still have the default set of publishers we can configure different steps here
|
// For Jobs that should still have the default set of publishers we can configure different steps here
|
||||||
if(poijob.gradle) {
|
if(poijob.gradle) {
|
||||||
|
Loading…
Reference in New Issue
Block a user