Search code examples
jenkinsjenkins-pipelinejenkins-pluginsudeployucd

how to integrate UCD in jenkins pipeline?


I am trying to integrate IBM Urban Code Deploy in my Jenkins pipeline. Earlier I have integrated UCD using freestyle job using IBM UrbanCode Deploy Plugin. Now When I am trying to do the same using pipeline script, it is giving error. Unable to find many resources on the internet. Here is my Deploy stage.

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'
                ]
              )
        }
    }

I am getting the following error.

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

Solution

  • UCDeployPublisher is a class, not a step. According to the docs you can use it with general step:

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