Код IT
← Каталог

Job DSL Playground — jobs Jenkins как код — pipelineJob — Pipeline from SCM

Фрагмент из «Job DSL Playground — jobs Jenkins как код»: pipelineJob — Pipeline from SCM.

Groovy main.groovy
pipelineJob('shop-build') {
    description('Сборка shop — ветка main')
    definition {
        cpsScm {
            scm {
                git {
                    remote { url('https://github.com/example/shop.git') }
                    branch('main')
                }
            }
            scriptPath('Jenkinsfile')
        }
    }
    triggers {
        scm('H/15 * * * *')
    }
}
pipelineJob('shop-build') {
    description('Сборка shop — ветка main')
    definition {
        cpsScm {
            scm {
                git {
                    remote { url('https://github.com/example/shop.git') }
                    branch('main')
                }
            }
            scriptPath('Jenkinsfile')
        }
    }
    triggers {
        scm('H/15 * * * *')
    }
}