Skip to content

Commit

Permalink
Add container as allowed method for pipelines using kubernetes
Browse files Browse the repository at this point in the history
  • Loading branch information
Willem Borgesius authored and Willem Borgesius committed Sep 17, 2020
1 parent 71220f3 commit 03861af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ abstract class BasePipelineTest {
helper.registerAllowedMethod("choice", [Map])
helper.registerAllowedMethod('cifsPublisher', [Map], {true})
helper.registerAllowedMethod('cleanWs')
helper.registerAllowedMethod("container", [String, Closure], { String path, Closure c ->
c.delegate = delegate
helper.callClosure(c)
})
helper.registerAllowedMethod('copyArtifacts', [Map], {true})
helper.registerAllowedMethod("cron", [String])
helper.registerAllowedMethod('deleteDir')
Expand Down
4 changes: 3 additions & 1 deletion src/test/jenkins/jenkinsfiles/Kubernetes_Agent_Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ pipeline {
}
steps {
echo 'Hello, Kubernetes'
sh 'mvn --version'
container("maven"){
sh 'mvn --version'
}
}
}
stage('Example Test') {
Expand Down

0 comments on commit 03861af

Please sign in to comment.