Cole9350
Cole9350

Reputation: 5560

Jenkins Build Periodically - Once

I am trying to schedule a Jenkins Deployment task to run only once.
Why? So no one has to log in remotely to do after hours deployments (No Fun!)

So my question is: Is there a way to specify year within jenkins' cron syntax?

More info: Under Build Triggers -> Build Periodically
If I schedule a build for today(Thursday, June 10th) at 10:52 AM
The cron syntax would be 52 10 10 6 2

However, the next June 10th will occur in the year 2025, so technically, the build will still be scheduled for 11 years from now, unless I manually remove the schedule.

This is not a huge problem, it just doesn't make sense to me someone hasn't come up with a solution for it yet.

I am not looking for hacks, scheduled tasks, or scripting... All of that would be more work then just manually removing the schedule. I would like to keep this completely inside of jenkins

If this is truly impossible, I will consider writing a plugin for this specific use-case.

Upvotes: 1

Views: 1566

Answers (1)

Cole9350
Cole9350

Reputation: 5560

Well after much digging I finally found it:
https://wiki.jenkins-ci.org/display/JENKINS/Schedule+Build+Plugin

enter image description here

It adds ^^ the schedule build button to all projects which provides a nice UI to set a date and time, instead of dealing with that ridiculous cron syntax.

Jenkins' Modo should be "There's a plugin for that"

Upvotes: 2

Related Questions