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.
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.