Well that refactoring idea didn't work out

How does this even work.

    groovy.lang.MissingPropertyException: No such property: none for class: defaultsFor
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:458)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.getProperty(DefaultInvoker.java:34)
	at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
	at defaultsFor.defaultsForJava(/var/jenkins_home/jobs/joni/branches/defaults/builds/5/libs/pipeline-library/vars/defaultsFor.groovy:20)
	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.call(jar:file:/var/jenkins_home/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:54)
This commit is contained in:
R. Tyler Croy 2017-12-13 16:57:32 -08:00
parent 549ea61e13
commit 1e8863ee5c
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
1 changed files with 38 additions and 42 deletions

View File

@ -5,7 +5,44 @@
def call(String platform) {
switch (platform) {
case 'maven':
defaultsForMaven()
pipeline {
agent none
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
timeout(time: 1, unit: 'HOURS')
}
stages {
stage('Test') {
failFast true
parallel {
stage('Linux') {
agent { docker 'maven:3-alpine' }
steps {
sh 'mvn test -B'
}
post {
always {
junit testResults: '**/surefire-reports/**/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: '**/*.jar', fingerprint: true
}
}
}
stage('FreeBSD 11') {
agent { label 'freebsd' }
steps {
sh 'mvn test -B'
}
post {
always {
junit testResults: '**/surefire-reports/**/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: '**/*.jar', fingerprint: true
}
}
}
}
}
}
}
return
break
@ -14,44 +51,3 @@ def call(String platform) {
break
}
}
void defaultsForMaven() {
pipeline {
agent none
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
timeout(time: 1, unit: 'HOURS')
}
stages {
stage('Test') {
failFast true
parallel {
stage('Linux') {
agent { docker 'maven:3-alpine' }
steps {
sh 'mvn test -B'
}
post {
always {
junit testResults: '**/surefire-reports/**/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: '**/*.jar', fingerprint: true
}
}
}
stage('FreeBSD 11') {
agent { label 'freebsd' }
steps {
sh 'mvn test -B'
}
post {
always {
junit testResults: '**/surefire-reports/**/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: '**/*.jar', fingerprint: true
}
}
}
}
}
}
}
}