|
|
@@ -25,30 +25,21 @@ projects.each {
|
|
|
def jenkinsFile = restExists("${api}/repos/${project}/raw/master/Jenkinsfile?token=${apikey}")
|
|
|
def jobName = "${JOB_PREFIX}${project}".replaceAll('/','-')
|
|
|
if (jenkinsFile) {
|
|
|
- pipelineJob(jobName) {
|
|
|
+ multibranchPipelineJob(jobName) {
|
|
|
+ description("Pipeline for $repo")
|
|
|
triggers {
|
|
|
- scm('@hourly')
|
|
|
+ cron('@hourly')
|
|
|
}
|
|
|
- description("Pipeline for $repo")
|
|
|
- quietPeriod(5*60)
|
|
|
- environmentVariables(FOO: 'bar', TEST: '123')
|
|
|
- definition {
|
|
|
- cpsScm {
|
|
|
- scm {
|
|
|
- git {
|
|
|
- remote {
|
|
|
- url(repo)
|
|
|
- credentials(GOGS_CREDENTIALS)
|
|
|
- }
|
|
|
- branches('master', '**/feature*')
|
|
|
- scriptPath('Jenkinsfile')
|
|
|
- extensions { } // required as otherwise it may try to tag the repo, which you may not want
|
|
|
- }
|
|
|
- }
|
|
|
+ branchSources {
|
|
|
+ git {
|
|
|
+ remote(repo)
|
|
|
+ credentialsId(GOGS_CREDENTIALS)
|
|
|
}
|
|
|
}
|
|
|
- wrappers {
|
|
|
- buildName('#${BUILD_NUMBER} on ${ENV,var="BRANCH"}')
|
|
|
+ orphanedItemStrategy {
|
|
|
+ discardOldItems {
|
|
|
+ numToKeep(10)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|