Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No "Build Triggers" option for Blue Ocean pipeline

I have researched this issue a lot and cannot find an answer to that, so I have setup a simple project on Jenkins before and I get all the perks of the "Build Triggers" tab where I can select exactly what could trigger the project build (for example pull requests).

However, in the Blue Ocean project I can only see these options under the specific branch > View Configuration, and it doesn't allow me to save any of the options configured, it just shows the configs and there is no save button. I have attached the screenshots below:

This is the Project > Configuration, it allows me to save changes and everything but has no option for build triggers. Project Configs

This is under Project > Branch (master) > View Configurations, it shows the build triggers I want but no option to apply these changes into that specific branch. Branch Configs

So, I guess the question is, how can I add the build triggers to my blue ocean pipeline?

like image 247
Blizzard Avatar asked Nov 30 '17 03:11

Blizzard


1 Answers

The build triggered seen under a branch should be the reflection of the trigger directive made in a Jenkinsfile directive which is either:

  • cron
    Accepts a cron-style string to define a regular interval at which the pipeline should be re-triggered, for example:

    triggers { cron('H */4 * * 1-5') }
    
  • pollSCM
    Accepts a cron-style string to define a regular interval at which Jenkins should check for new source changes. If new changes exist, the pipeline will be re-triggered. For example:

    triggers { pollSCM('H */4 * * 1-5') }
    
  • upstream
    Accepts a comma separated string of jobs and a threshold.
    When any job in the string finishes with the minimum threshold, the pipeline will be re-triggered. For example:

    triggers { upstream(upstreamProjects: 'job1,job2', 
                        threshold: hudson.model.Result.SUCCESS) }
    

That would be paired with a when directive, which specifies the branch

branch
Execute the stage when the branch being built matches the branch pattern given, for example:

when { branch 'master' }

Note that this only works on a multibranch Pipeline.

like image 124
VonC Avatar answered Oct 11 '22 05:10

VonC