简体   繁体   English

Jenkins带回购的声明式管道

[英]Jenkins declarative pipeline with repo

I'm using Jenkins with declarative pipeline and I need to create a job triggered by any modification on a repo repository and all dependent projects inside the manifest. 我正在使用带有声明性管道的 Jenkins,我需要创建一个由repo存储库上的任何修改以及清单中所有依赖项目触发的作业。

Actually I've to do the following fetch and trigger all my dependencies: 实际上,我必须执行以下提取并触发所有依赖项:

pipeline {
  agent any
  stages {
    stage('fetch') {
      steps {
        sh 'repo init -u ${MY_REPO_URL}'
        sh 'repo sync'
      }
    }
  }
}

In a Freestyle project with repo plugin , I only need to add: 在带有repo插件的Freestyle项目中,我只需要添加:

在此输入图像描述

But there is no "Source Code Management" in a pipeline job 但是在管道工作中没有“源代码管理”

What can I do ? 我能做什么 ?

Thanks 谢谢

Ok, what I wasn't understanding is that pollSCM autodetect repo project. 好吧,我不理解的是pollSCM autodetect repo项目。 So with scheduled trigger, all repositories are checked. 因此,使用计划触发器,将检查所有存储库。

Also, with the pipeline syntax generator I've found this pretty way for init and sync my repository: 另外,借助管道语法生成器,我发现了用于初始化和同步我的存储库的漂亮方法:

    checkout changelog: true, poll: false, scm: [$class: 'RepoScm', currentBranch: true, \
        forceSync: true, jobs: 4, manifestBranch: manifestRev, \
        manifestRepositoryUrl: manifestRepo, \
        quiet: false, resetFirst: fullClean, resetFirst: fullReset]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM