• 1.  jenkins plugin UCDeployPublisher

    Posted Mon September 20, 2021 12:38 PM
    Hello I am using Jenkins scripted pipeline  to  call UCD process . I am trying to figure out how can i get the exit status from the called function def deployucd()

    base upon the status would like to fail/pass the jenkins pipeline

    calling function from a groovy file 

    Here is the groovy file 

    #!/usr/bin/env groovy

    def deployucd(String Name) {
    stage (" Shakeout ${Name}") {
    step([$class: 'UCDeployPublisher',
    siteName: 'UCD Prod',
    deploy: [
    $class: 'com.urbancode.jenkins.plugins.ucdeploy.DeployHelper$DeployBlock',
    deployApp: APPLICATION_NAME,
    deployEnv: envName,
    deployProc: SHAKEOUTPROCESS,
    skipWait: false,
    deployReqProps: DEPLOYREQPROPS,
    deployVersions: DEPLOYVERSION,
    deployOnlyChanged: false

    Mehul prajapati

  • 2.  RE: jenkins plugin UCDeployPublisher

    User Group Leader
    Posted Tue September 21, 2021 12:48 PM

    Could you detail your question a little bit more as i haven't understood if you want to react on the result of the function call or is the question regarding the class invocation in the function?

    Regarding result of function call it could look like this:
    def returnValue // needs to be a global variable
    ... your pipeline
                returnValue = deployUCD(NAME)
                echo "The return value is ${returnValue}"

    Osman Burucu
    Product Manager UrbanCode Family

  • 3.  RE: jenkins plugin UCDeployPublisher

    Posted Wed September 29, 2021 10:12 AM

    so question was, i am using scripted jenkins pipeline as code 

    1. how can i get the the return value of  a function which is executing the UCDeployPublisher class.
    2. if the UCDeployPublisher is executed successfully what value does it return for success and failure 
    3 When the publisher class is called from deployUCD(NAME) i see this error in the logs 
    Skip artifacts upload to IBM UrbanCode Deploy - build failed or aborted.
    Exception occurred during Deployment of test environment. Aborting the stage.hudson.AbortException: Skip artifacts upload to IBM UrbanCode Deploy - build failed or aborted.- Error signal
    i am unable to understand why should it  try to upload the artifact ? my expectation is this class should deploy the code

    Mehul prajapati