We are using the Lockable Resource Plugin to prevent certain parts of our jobs from running simultaneously. I'd like to allow a job to start and gather input parameters using the "Input Step" then queue while waiting for any blocking locks to clear, then proceed. Instead, I see the whole job blocking and not allowing me to enter input until all locks are cleared even though I have the Input Step outside of the Lock block.
What am I doing wrong?
Here is an example:
// Define an input step and capture the outcome from it.
def outcome = input id: 'deployment',
message: 'Deployment Configuration',
ok: 'Deploy',
parameters: [
[
$class : 'hudson.model.ChoiceParameterDefinition', choices: "development",
name : 'stack',
description: 'select a stack to deploy'
],
[
$class : 'hudson.model.ChoiceParameterDefinition', choices: "choice1\nchoice2",
name : 'profile',
description: 'select a profile to deploy'
],
]
def profile = "${outcome.get('profile')}"
def stack = "${outcome.get('stack')}"
echo "profile: ${profile}"
echo "stack: ${stack}"
// use lockable resource to prevent multiple jobs of the same project from running at the same time.
lock(resource: "deployment") {
sh "echo running deployment script here."
}