Skip to content

Instantly share code, notes, and snippets.

@tacahiroy
Created August 6, 2019 06:00
Show Gist options
  • Save tacahiroy/cb93df93dd3ac14cb8a9fe495ddeb866 to your computer and use it in GitHub Desktop.
Save tacahiroy/cb93df93dd3ac14cb8a9fe495ddeb866 to your computer and use it in GitHub Desktop.
Setup Git polling with Jenkins declarative pipeline
pipeline {
agent {
node {
label any
}
}
triggers {
pollSCM 'H 20 * * 1-5'
}
stages {
stage('checkout') {
steps {
checkout scm: [$class: 'GitSCM',
userRemoteConfigs: [[url: 'git@git.local:xxx/foo.git',
credentialsId: 'myCredId']],
branches: [[name: 'refs/heads/master']]
], poll: true
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment