Details
-
Improvement
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
Description
I want to be able to use trigger with cron but only for the master branch.
if and when both don't work in the trigger context.
Here is what I expected to work:
if (env.BRANCH == 'master') { trigger { cron('@daily') } }
Attachments
Issue Links
- is duplicated by
-
JENKINS-48898 Multibranch pipeline: conditional triggers
-
- Closed
-
- relates to
-
JENKINS-52203 Provide a 'prerequisites' sections (like triggers) that allows blocking the execution of a job
-
- Open
-
kaibutsux, I found https://plugins.jenkins.io/parameterized-scheduler while looking for this same feature.
My use case is a little different. I have a build that deploys software, but I want that software to get cleaned up some fixed number of hours after the last build. What I really want is to schedule a one time build, but I realized I might be able to use triggers for this. When the initial build runs, I dynamically generate the cron to run at a time that would be the number of hours later that I want. When the clean up build runs, I would set the cron trigger to an empty string, so it effectively on runs one time...