void createCiPipeline()

in deploy-templates/JobProvisioner.groovy [148:194]


void createCiPipeline(String pipelineName, String codebaseName, String codebaseBranch, String stages,
                      String repositoryPath, String deploymentMode, boolean trigger = true) {
    pipelineJob("${codebaseName}/${codebaseBranch.toUpperCase().replaceAll(/\//, "-")}-${pipelineName}") {
        concurrentBuild(false)
        logRotator {
            numToKeep(10)
        }
        if (trigger) {
            triggers {
                gerrit {
                    events {
                        if (pipelineName.contains("Code-review"))
                            patchsetCreated()
                        else
                            changeMerged()
                    }
                    project("plain:${codebaseName}", ["plain:${codebaseBranch}"])

                    configure {
                        if (pipelineName.contains("Code-review")) {
                            it / 'triggerOnEvents' / 'com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events.PluginPatchsetCreatedEvent' <<  {
                                'excludePrivateState'(true)
                            }
                        }
                    }
                }
            }
        }
        definition {
            cps {
                script("@Library(['edp-library-pipelines']) _ \n\nBuild()")
                sandbox(true)
            }
            parameters {
                if (codebaseName == "registry-regulations" && !pipelineName.contains("data-model") && !pipelineName.contains("Code-review") )
                    booleanParam("FULL_DEPLOY", false)
                stringParam("STAGES", stages)
                stringParam("CODEBASE_NAME", codebaseName)
                stringParam("CODEBASE_BRANCH", codebaseBranch)
                stringParam("REPOSITORY_PATH", repositoryPath)
                stringParam("LOG_LEVEL", "INFO", "ERROR, WARN, INFO or DEBUG")
                stringParam("DEPLOYMENT_MODE", deploymentMode)
            }

        }
    }
}