How can I use post step in Jenkins pipeline with kubernetes plugin
As of this writing, Post
is only supported in declarative pipelines.
You could have a look at their declarative example if you absolutely must use post
.
pipeline { agent { kubernetes { //cloud 'kubernetes' label 'mypod' containerTemplate { name 'maven' image 'maven:3.3.9-jdk-8-alpine' ttyEnabled true command 'cat' } } } stages { stage('Run maven') { steps { container('maven') { sh 'mvn -version' } } } }}