Aditya
Aditya

Reputation: 1261

Trigger a periodic build based on another build in Jenkins

I have a job in jenkins which will specify an integer parameter called days. I want to build a secondary job such that it triggers based on the days parameter in a cron.
I find that we can setup a cron job to trigger a project on a set of specifications(hours, days...) but is there a way I can build the project based on the integer parameter of the other job?
There is no specific code to show here, just parameters. I am not sure if this is the appropriate platform for this question.

Upvotes: 0

Views: 72

Answers (2)

Aditya
Aditya

Reputation: 1261

My task was accomplished using the Quiet Period option in the general project settings. I created an intermediate job which would trigger after a specified amount of Quiet Period in seconds and it would call the final job. It was getting a little complex to do the same using cron jobs however this approach seemed the most straightforward.

Upvotes: 0

Alex O
Alex O

Reputation: 8164

Your task can be accomplished by implementing a 'SCM polling' scheme that checks for the required trigger reason (some other job's days parameter, in your case).

Implementing such a polling scheme can be done by implementing a custom Jenkins plugin just for that. Depending on how deep you're into Jenkins development, this can represent a major task, though.

The Script SCM plugin allows to implement the key SCM steps as groovy code snippets, which is very convenient for tasks like yours. Unfortunately, the plugin is currently on hold for security reasons. Depending on your setup, this may not be a blocker, though.

Upvotes: 1

Related Questions