I already used the following declarative cleanup pipeline for Jenkin, 
according to the feature of my code, I have to convert into the scripted 
pipeline, how I can convert it to the scripted pipeline?
stage ('Cleanup Feature Releases') {
     steps {
         script {
             envParameters = Utils.getEnvParameters("${TARGET_ENV}")
              withKubeConfig([credentialsId: envParameters.K8S_TOKEN,
                                             serverUrl: 
envParameters.K8S_API_SERVER,
                                             contextName: CONTEXT_NAME
                ]) {
                sh "Running on ${params.OVERRIDE_NAMESPACE}"
             }
          }
     }
     post {
         failure {
                cleanUpNotification("FAILURE", params.DRY_RUN)
          }
          aborted {
                 cleanUpNotification("ABORTED", params.DRY_RUN)
           }
           success {
                  cleanUpNotification("SUCCESS", params.DRY_RUN)
           }
        }
    }

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/349c3bc3-d9db-48a0-afca-2faeefe13fa1n%40googlegroups.com.

Reply via email to