-
New Feature
-
Resolution: Fixed
-
Major
-
None
-
-
Pipeline - December
Problem
In Declarative it is not possible to wrap a timeout out side of a stage and not have it utilise the agent.
stage('Continue deploy') { agent none steps { timeout(time: 1, unit: 'DAYS') { input 'Continue deploy?' } } } stage('deploy') { agent { label 'deployer' } steps { echo 'deploy' } }
Solution
It would be great if we could have something like the following (assuming JENKINS-48379)
stage('deploy') { timeout { time: 1 unit: DAYS } input { input 'Continue deploy?' } steps { echo 'deploy' } }
- is duplicated by
-
JENKINS-43336 Allow locking multiple stages in declarative pipeline
-
- Closed
-
- relates to
-
JENKINS-48379 Input/parameters for Stages
-
- Closed
-
- links to
Linking this to
JENKINS-48379- what we need here is something like options at the top level, a container for steps that wrap the entire stage or run before the stage body gets going. This does get a bit hairier for the input sort of case, because that’d always execute before when gets evaluated, but we’ve made the decision that agent precedes when (because one of the two has to be first, and the hassle from getting the agent is less of a problem than the limitations resulting from not being able to do anything on the agent for a when condition) so that’s just how the cookie crumbles, as it were.