Bài này cấu hình cho jenkins liên tục triggers git. Nếu commit thay đổi thì thực hiện action build.
Scripted Pipeline như sau:
node {
properties([
pipelineTriggers([
pollSCM('* * * * *')
])
])
stage('Build'){
checkout([
$class: 'GitSCM',
branches: [[name: "origin/master"]],
userRemoteConfigs: [[
url: 'https://github.com/mrnim94/scripted-pollSCM.git'
]]
])
}
}
![](https://nimtechnology.com/wp-content/uploads/2022/01/image-13.png)
![](https://nimtechnology.com/wp-content/uploads/2022/01/image-14.png)
![](https://nimtechnology.com/wp-content/uploads/2022/01/image-15.png)