Hi
The triggers - pollscm doesn't work on the checkout step.
I want that the pollscm will trigger a build in every push in - 
checkout([$class: 
'GitSCM', branches: [[name: '*/master']], ...
This didn't work for me:

pipeline {
    triggers {
            pollSCM('*/5 * * * *')
    }
    agent { label 'web-ui-04888827' }

    stages {
        

        stage('Build') {
            steps {
                checkout([$class: 'GitSCM', branches: [[name: '*/master']], 
doGenerateSubmoduleConfigurations: false, extensions: [[$class: 
'RelativeTargetDirectory', relativeTargetDir: 'cloudify-stage']], submoduleCfg: 
[], userRemoteConfigs: [[credentialsId: '5006a20b-84d4-4681-ae49-886247acd47b', 
url: 'https://github.com/cloudify-cosmo/cloudify-stage.git']]])
                dir('cloudify-stage') {
                    sh '''sudo npm install
                          sudo npm install webpack -g
                          sudo npm install bower -g
                          sudo npm install gulp -g
                          sudo npm install grunt-cli -g
                          bower install'''
                    dir('semantic') {
                        sh 'gulp build'
                    }
                    sh 'grunt build'
                    dir('backend') {
                        sh 'npm install'
                    }
                    sh 'webpack --config webpack.config-prod.js --bail'
                    sh 'sudo chown jenkins:jenkins -R .'
                }
            }
        }

}


On Sunday, March 5, 2017 at 4:40:05 PM UTC+2, Bill Dennis wrote:
>
> If your Jenkinsfile is in the same repo, using declarative pipeline you 
> can have triggers in the pipeline to do this:
>
> pipeline {
>  triggers {
>         pollSCM('*/5 * * * *')
>  }
> ...
> }
>
> It works for me using subversion.
>
> Bill
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ceb9345b-1af2-492d-9550-060bb0efe89c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to