No such property: LastExitCode for class: groovy.lang.Binding

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • Component/s: pipeline
    • Environment:

      I'm doing Unreal Engine Game development and want to use Jenkins to automate the process of building, compiling and packaging the game.

      However, I'm trying to use powershell to run an executable file AutomationTool.exe and it does successfully exited with code 0 however pipeline will always failed with same error. 

      No such property: LastExitCode for class: groovy.lang.Binding

      Here's the code:

      stage('BuildCookRun Server [BUILD]') {
        when {
            expression { params.BUILD_SERVER == true }
        }
        steps {
            script {
                powershell(
                    label: "Running UnrealAutomationTool.exe BuildCookRun [Build]",
                    returnStdout: false,
                    script: """\$Options = @(
                        \'BuildCookRun\'
                        \'-build\'
                    )
                    & (\"${ENGINE_PATH}//Engine//Binaries//DotNet//AutomationTool.exe\") @Options
                    echo \"LASTEXITCODE is \$LASTEXITCODE\"
                    """
                )
            }
        }
      }

       

            Assignee:
            Ariff Azman
            Reporter:
            Ariff Azman
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: