“Build Periodically” with a Multi-branch Pipeline in Jenkins

后端 未结 5 762
南旧
南旧 2020-11-30 20:29

I\'m running Jenkins 2 with the Pipeline plugin. I have setup a Multi-branch Pipeline project where each branch (master, develop, etc.) has a Jenkinsfile in the root. Settin

5条回答
  •  情话喂你
    2020-11-30 20:57

    If you are using a declarative style Jenkinsfile then you use the triggers directive.

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

提交回复
热议问题