I want to trigger a Jenkinsjob every 2nd Tuesday. What I learned so far, is that this is not possible that easy. So I was trying something like this:
stage('Setup build schedule') {
properties([
pipelineTriggers([
cron('0 20 * * 2')
])
])
}
def build_number = env.BUILD_NUMBER as int
if ((build_number % 2) == 0) {
...
}
which is okay. But sometimes i also want to trigger this Multibranch-Pipeline Job by hand. Is it possible to set a variable only during the cron triggered start? Then I can check if this variable is set, and if not I know it is triggered by handy and proceed that way?