【问题标题】:Want to know how PollSCM pick the repo to poll in Jenkins Pipeline想知道 PollSCM 如何在 Jenkins Pipeline 中选择 repo 进行投票
【发布时间】:2019-12-12 11:58:24
【问题描述】:

作业似乎没有被 GIT 提交触发,Pollscm 会在下面的“Pull src”阶段选择 repo 吗?或者请让我知道如何将 repo 传递给 PollSCM,以便在 git repo 提交更改后触发构建?

 node( ) {
        properties([ 
            buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '40')),
            disableConcurrentBuilds(), 
            parameters([
                string(defaultValue: '', description: '', name: 'BRANCH', trim: false), 
                ]), 
            pipelineTriggers([pollSCM('H/10 * * * *')])
        ])
        stage('Clean Workspace') {
            cleanWs deleteDirs: true
        }
        stage('Pull src') {
            git branch: env.BRANCH, credentialsId: 'git', url: 'git@github.com:something/something'
        }
        stage('Pack'){
}
}

【问题讨论】:

    标签: git jenkins jenkins-pipeline jenkins-plugins devops


    【解决方案1】:

    PollSCM 自动选择处于“Pull src”阶段的存储库,我在纠正它后遇到了我的 GIT 凭证问题,上述工作运行良好,按规定定期轮询并在提交时运行构建。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-24
      相关资源
      最近更新 更多