Provide option to not unlock resource when job is finished
We have a need where we do not want to unlocked the locked resource so we can troubleshoot test failures.
We currently use declarative pipeline and lock the resource in the options "steps"
e.g.:
pipeline {
options {
lock(...)
}
}
Can we have an option doNotUnlockResource or something similar, that will leave the resource locked when we exit the lock block?
e.g.:
pipeline {
options {
lock(...)
}
stages {
stage("") {
// do stuff
}
// more stages
post {
always {
doNotUnlockResource
}
}
}
}
Not a duplicate, but maybe a synergetic idea with #142 and #64. The difference being that this proposal hardcodes the not-unlocking into the pipeline (might be ok with post { failure {...} }) processing, but as long as the same now-finished build name is still the lock-holder, it might be auto-released with #137 solved).
Duplicate to #253