Папка организации конвейера Jenkins Multibranch с JCasC не инициализируется при запуске — требуется «Сохранить» через пользовательский интерфейс

Я настраиваю Jenkins 2.332.3 с JCasC и конвейером Multibranch. Конвейер в целом в порядке, но требует, чтобы мы нажали Эта папка пуста | Настроить проект а потом Сохранять чтобы он распознавал любые задания при первой инициализации экземпляра jenkins!

Ожидаемое поведение: когда модуль kubernetes инициализируется и Jenkins запускается в первый раз, он должен автоматически воздействовать на настроенный многоветвевой конвейер, создавая экземпляры заданий. Он НЕ должен отображать веб-страницу «Эта папка пуста | Настроить проект», и проект уже должен быть «сохранен».

Любые идеи о том, как включить автоматическую настройку многоветвевого проекта, будут высоко оценены.

Наш код JCasC приведен ниже:

jobs: |
    jobs:
      - script: >
          organizationFolder('Xobabia Organisation') {
            buildStrategies {
                skipInitialBuildOnFirstBranchIndexing()
            }
            description("Xobabia Organisation")
            displayName('Xobabia Organisation')
            // "Projects"
            organizations {
              bitbucket {
                serverUrl("https://xobabia.com")
                repoOwner("xobabia")
                credentialsId("${XOBABIA_SECRET_BITBUCKET_APP_CREDS_USERNAME}")
                // "Traits" ("Behaviours" in the GUI) that are "declarative-compatible"
                // traits {
                //  webhookRegistrationTrait {
                //    mode('ITEM')
                //  }
                //}
              }
            }
            // "Traits" ("Behaviours" in the GUI) that are NOT "declarative-compatible"
            // For some 'traits, we need to configure this stuff by hand until JobDSL handles it
            // https://issues.jenkins.io/browse/JENKINS-45504
            configure { node ->
                def traits = node / navigators / 'com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator' / traits
                // Filter by name (with regular expression)
                traits << 'jenkins.scm.impl.trait.RegexSCMSourceFilterTrait' {
                    regex('infra-k8s-namespaces-and-quotas|infra-jenkins-tests|infra-aws-iam|infra-docker|infra-k8s-rbac|infra-terraform-keycloak')
                }
                // Discover branches
                traits << 'com.cloudbees.jenkins.plugins.bitbucket.BranchDiscoveryTrait' {
                    strategyId('1')
                    // Values
                    //  1 : Exclude branches that are also filed as PRs
                    //  2 : Only branches that are also filed as PRs
                    //  3 : All branches
                }
                traits << 'com.cloudbees.jenkins.plugins.bitbucket.SSHCheckoutTrait' {
                    credentialsId('bitbucket-ssh')
                }
                // Discover pull requests from origin
                traits << 'com.cloudbees.jenkins.plugins.bitbucket.OriginPullRequestDiscoveryTrait' {
                    strategyId('1')
                    // Values
                    // 1 : Merging the pull request with the current target branch revision
                    // 2 : The current pull request revision
                    // 3 : Both the current pull request revision and the pull request merged with the current target branch revision
                }
                // Discover pull requests from forks
                traits << 'com.cloudbees.jenkins.plugins.bitbucket.ForkPullRequestDiscoveryTrait' {
                    strategyId('1')
                    // Values
                    // 1 : Merging the pull request with the current target branch revision
                    // 2 : The current pull request revision
                    // 3 : Both the current pull request revision and the pull request merged with the current target branch revision
                    trustID('2')
                    // Values
                    // 0 : Everyone
                    // 1 : Forks in the same account
                    // 2 : Nobody
                }
            }
            // "Project Recognizers"
            projectFactories {
                workflowMultiBranchProjectFactory {
                    scriptPath 'Jenkinsfile'
                }
            }
            // "Orphaned Item Strategy"
            orphanedItemStrategy {
              discardOldItems {
                daysToKeep(10)
                numToKeep(10)
              }
            }
            // "Scan Organization Folder Triggers" : 1 day
            // We need to configure this stuff by hand because JobDSL only allow 'periodic(int min)' for now
            configure { node ->
              node / triggers / 'com.cloudbees.hudson.plugins.folder.computed.PeriodicFolderTrigger' {
                spec('H H * * *')
                interval(86400000)
              }
            }
          }

Огромное спасибо

Дженкинс Дженкинс-мультифилиал

Бануна

0

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *