I am getting below error in Jenkins Pipeline Job:
java.lang.UnsupportedOperationException: no known implementation of class
jenkins.tasks.SimpleBuildWrapper is named OpenShiftBuildWrapper at org.jenkinsci.plugins.structs.describable.DescribableModel.resolveClass(DescribableModel.java:549)
at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:473) at org.jenkinsci.plugins.structs.describable.DescribableModel.buildArguments(DescribableModel.java:409)
Caused: java.lang.IllegalArgumentException: Could not instantiate {delegate={$class=OpenShiftBuildWrapper, url=https://in-console.appcanvas.net:8443, credentialsId=jenkins-paas-token, installation=oc-latest, insecure=true}} for org.jenkinsci.plugins.workflow.steps.CoreWrapperStep
at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:334)**
The step in Jenkinsfile which is causing issue is -
stage('Deploy to Demo AppCanvas') {
when {
expression {
env.BRANCH_NAME=='develop'
}
}
steps{
script{
// withCredentials([string (credentialsId: 'jenkins-paas-token', variable: 'OPENSHIFT_AUTH_TOKEN')]) {
if (env.BRANCH_NAME=='develop') {
echo "Promoting application from " + properties.project_dev + " to " + properties.project_demo
OPENSHIFT_CONSOLE_URL = 'https://in-console.appcanvas.net:8443'
}
AUTH_TOKEN_DEMO = 'jenkins-paas-token'
if(env.BRANCH_NAME=='develop') {
StageToDemoDeployToAppCanvas(properties.project_demo,properties.oc_app_name,properties.project_stage,IMAGE_TAG,OPENSHIFT_CONSOLE_URL,AUTH_TOKEN_DEMO)
}
// }
}
}
}
Below is the part of code snippet from StgToDemoDeployToAppCanvas.groovy -
def call(String project_demo, String oc_app_name, String project_stage, String IMAGE_TAG, String OPENSHIFT_CONSOLE_URL, String OPENSHIFT_AUTH_TOKEN){
wrap([$class: 'OpenShiftBuildWrapper', url: OPENSHIFT_CONSOLE_URL, credentialsId: OPENSHIFT_AUTH_TOKEN, installation: 'oc-latest', insecure: true])