简体   繁体   中英

Want to know how PollSCM pick the repo to poll in Jenkins Pipeline

The Job doesn't seem to get triggered by GIT commits, will the Pollscm pick the repo in the 'Pull src' stage below? Or kindly let me know how to pass the repo to PollSCM, for the build to be triggered once the git repo has committed a change?

 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'){
}
}

PollSCM picks the repo thats in the stage 'Pull src' automatically, I had an issue with my GIT credentials post correcting it, the above job worked fine, polled periodically as stated and ran the build on commits.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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