-->

DEVOPSZONES

  • Recent blogs

    How to Build periodically in jenkins multibranch pipeline

    How to Build periodically in jenkins multibranch pipeline


    Generally we use "GitHub hook trigger for GITScm polling" to trigger our Pipeline. If we want to trigger our build periodically we need check the "Build periodically" option in the build section. 


    jenkins build Periodically

    However In the Multilbranch Pipeline the we do not have the build trigger section available. If We want to "Build periodically" for a multibranch pipeline then we need to change our Jenkinsfile to do that. Let's check how to Configure that.

    You need to add following steps to your Jenkinsfile.

    pipeline {
        agent any
        triggers {
            cron('H 4/* 0 0 1-5')
        }
        stages {
            stage('build') {
                steps {
                    echo 'This Show Periodic Builds'
                }
            }
        }
    }


    Cron schedule

    No comments