I am looking to disable a jenkins job for some amount of time like 4 hours from now.
For eg I want to disable a job for 4 hours starting from 11 am, could you please let me know whether it is possible?
I am looking to disable a jenkins job for some amount of time like 4 hours from now.
For eg I want to disable a job for 4 hours starting from 11 am, could you please let me know whether it is possible?
You could make two helper jobs:
The actual enabling and disabling of jobs is easiest to do using jenkins command line client, either the java client (https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI) or the ssh client (https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+SSH)
At work I have set up exactly that kind of setup. I myself use the ssh client. To disable a job I use
ssh -p <jenkins ssh port> user@localhost disable-job <jobname>
It is a good idea to configure Jenkins to set up a static ssh port and set up a user with ssh key without password for this purpose.
The client command to enable a job is enable-job
.
You could leave the job as active and set up polling of the repository using CRONTAB syntax. The result would be the job would be non-responsive to repository commits outside the times you specify.
Simpler and achieves the same result.
I think that the Configuration Slicing Plugin could solve your problems. This plugin performs mass configuration of select project properties, including email, timer, discard old builds, Maven configuration, disable jobs, etc..