Unten ist meine Jenkinsfile.Jenkinsfile CPS Fehler
Der Build wird normalerweise bis zum Ende fortgesetzt, wenn ein Fehler generiert wird.
Ich bin nicht genug vertraut mit der Skript-Pipeline zu wissen, wie weiter?
Meine Vermutung ist, dass ich die Referenzvariable fälschlicherweise zum Andock-Container verwende?
Durch die Erwähnung von Sandbox, ist es möglich, dass ich die Stop-Methode nicht aufrufen darf?
node {
checkout scm
docker.withRegistry('http:localhost:5000') {
try {
stage 'Acquire HBASE Image'
def hbase = docker.image('hbase-1.1.2').run()
docker.image('jenkins-java').inside("--link=${hbase.id}:hbase"){
checkout scm
stage 'Build'
sh 'gradle build'
stage 'Test'
sh 'gradle test'
stage 'Publish Test Results'
junit 'build/test-results/*.xml'
stage 'Build Jar and Show Deps'
sh 'gradle dependencies'
sh 'gradle shadowJar'
stage 'Integration Test'
withEnv(['METRICS_BATCHSIZE=10','METRICS_ZOOKEEPER_QUOROM=hbase:2181']){
sh 'java -jar build/libs/$(ls ./build/libs/ | grep .jar) migrate'
sh 'gradle integrationTest'
}
stage 'Publish Integration Results'
junit 'build/test-results/*.xml'
}
}
finally {
hbase.stop()
}
}
}
Der Fehler ist
Could not update commit status, please check if your scan credentials belong to a member of the organization or a collaborator of the repository and repo:status scope is selected
groovy.lang.MissingPropertyException: No such property: hbase for class: groovy.lang.Binding
Possible solutions: class
at groovy.lang.Binding.getVariable(Binding.java:63)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:224)
at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:241)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:238)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:221)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:221)
at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:28)
at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
at WorkflowScript.run(WorkflowScript:46)
at org.jenkinsci.plugins.docker.workflow.Docker.withRegistry(jar:file:/var/lib/jenkins/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow