Jenkins Build Pipeline Scheduled Trigger

前端 未结 6 771
独厮守ぢ
独厮守ぢ 2020-12-13 06:15

How can a build pipeline be scheduled to execute at a certain time of the night just like a regular job can be?

6条回答
  •  天命终不由人
    2020-12-13 07:00

    Complete Example (taken from docs) Ref: https://jenkins.io/doc/book/pipeline/syntax/#triggers

    pipeline {
        agent any
        triggers {
            cron('H */4 * * 1-5')
        }
        stages {
            stage('Example') {
                steps {
                    echo 'Hello World'
                }
            }
        }
    }
    

提交回复
热议问题