如何将 UCD 集成到 jenkins 管道中?

how to integrate UCD in jenkins pipeline?

我正在尝试将 IBM Urban Code Deploy 集成到我的 Jenkins 管道中。早些时候,我已经使用 IBM UrbanCode Deploy Plugin 使用自由式作业集成了 UCD。现在,当我尝试使用管道脚本执行相同操作时,出现错误。无法在互联网上找到很多资源。这是我的部署阶段。

stage('Deploy') {
        steps {
            UCDeployPublisher (
                siteName: 'udeploy-server',
                component: [
                    componentName: 'DemoApp-APP',
                    delivery: [
                        pushVersion: '${BUILD_NUMBER}',
                        baseDir: '${WORKSPACE}',
                        fileIncludePatterns: '**/*',
                        fileExcludePatterns: '',
                        pushDescription: 'Pushed from Jenkins',
                        pushIncremental: false
                    ]
                ],
                deploy: [
                    deployApp: 'DemoApp',
                    deployEnv: 'Test 1',
                    deployProc: 'DemoApp Process'
                ]
              )
        }
    }

我收到以下错误。

java.lang.NoSuchMethodError: No such DSL method 'UCDeployPublisher' found among steps

UCDeployPublisher 是一个 class,不是一个步骤。根据 the docs you can use it with general step:

stage('Deploy') {
    steps {
        step([$class: 'UCDeployPublisher',
            siteName: 'udeploy-server',
            // ... and so on
        ])           
    }
}