0

I am working on a declarative pipeline which it is scheduled to run everyday after a certain time to shutdown an environment when not used (and restart it the morning after). However, sometimes tests need to be run on that environment and therefore I would like to have an option which allows to stop the pipeline from shutting down the env for that day... Does anyone knows how this would be possible?

This is the first time I work with jenkins so I am quite clueless at the moment. Thanks in advance.

fs314
  • 99
  • 1
  • 7
  • I have had this same requirement and there seems to be no feasible automated solution. The only option is to setup an approval each day and `approve` it each day which is a pain. If I am right, the tests run on random days and may run even for very long durations ~30 hours. – mdabdullah Jul 19 '20 at 16:58

1 Answers1

0

I don't think there's a clear way to do that but one option is to disable the job while you don't want it to run. Check here how to disable jobs.

You could also automate the disable and enable steps and include it on your tests job, so when tests are running the job is disabled and won't recreate the env.

nandilov
  • 699
  • 8
  • 18