Reputation: 111
Is it possible to have multiple plugins which are doing different jobs and triggered at different time independent of build - when build is pressed plugins do not trigger?
My current problem is that Jenkins is triggering plugins everytime build is pressed. I need to trigger it only at specific time.
I have tried Build Triggers - Schedule and Parameterized Trigger Plugin but with no success.
Upvotes: 2
Views: 2593
Reputation: 16605
Use Run Condition Plugin. Make the publishing build step conditional on a build parameter (let's name it DO_PUBLISH). Set that parameter to FALSE by default, so when the build is started by hand the publishing step is not triggered.
Now, create an auxiliary build that is scheduled to run daily at midnight and calls your main build via Parameterized Trigger Plugin with DO_PUBLISH parameter set to TRUE like this:
Let's say your build is called MY-BUILD. Create a new build TRIGGER-MY-BUILD. In Build Triggers check Build Periodically and enter Schedule (@daily
or 0 0 * * *
).
Install Parameterized Trigger plugin. Click on Add Build Step -> select Trigger/call builds on other projects -> enter MY-BUILD in Projects to build -> Add Parameters -> choose Predefined Parameters -> enter DO_PUBLISH=TRUE
in Parameters edit box.
Upvotes: 3