Jenkins groovy(脚本)管道的Git轮询设置

问题描述 投票:0回答:2

我正在尝试为groovy管道设置GIT轮询。脚本,而不是声明

git branch: '${Branch}',
    credentialsId: 'some.key.ssh',
    poll: true,
    url: "ssh://[email protected]/project-${env.Project}.git"

Git Branch由参数设置:Parameterized Builds for Jenkins Poll SCM设置为:* * * * * Poll config

我看到轮询工作 - 但它无法获得任何东西 - 它不会触发构建Poll log

所以问题是 - 有没有办法解决这个问题?请不要建议webhooks - 我不能使用它。只有民意调查SCM

git jenkins groovy continuous-integration jenkins-pipeline
2个回答
1
投票

在Jenkinsfile中你可以像这样使用cron:

pipeline {
    agent { label "master" }

    triggers { 
        cron('* * * * *') 
    }
    .
    .
    .
}

1
投票

使其与GitSCM一起使用

checkout([$class: 'GitSCM', 
     ranches: [[name: '*/master']], 
     doGenerateSubmoduleConfigurations: false, 
     extensions: [], 
     submoduleCfg: [], 
     userRemoteConfigs: [[url: 'https://github.com/unickq/allure-nunit.git']]])

片段生成器:

Plugin in steps generator

© www.soinside.com 2019 - 2024. All rights reserved.