Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-70024

Build periodically configuration is deleted in multi-branch pipeline

XMLWordPrintable

      Hello, 

      This case is on a declarative pipeline in a multi-branch pipeline.
      I define cron for the job so it will run periodically only on master a like this :

       

      CRON_SETTINGS = BRANCH_NAME == "master" ? '''0 0 * * 0''' : ""
      pipeline {
          agent { label 'master' }
          triggers {
               cron(CRON_SETTINGS)
          }    
          stages {
              stage('some stage') {
                  steps {
                      // do something
                  }
              }     
          }    
      }
      

       

       

      When I pushed to master this configuration, I saw in the branch configuration (on master), the section of Build Triggers -> Build periodically was defined with the configuration I set for it (0 0 * * 0). 

      But when I opened a new branch and push some changes (not necessarily related to these configuration changes), the master branch Build periodically configuration was deleted.

      Can you please help me to fix it and define periodic build only for the master branch?

       

      Before pushing some changes to another branch: 

      After pushing some changes to another branch: 

       

            Unassigned Unassigned
            yehuda_kahan Yehuda Kahan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: