lockable-resources-plugin icon indicating copy to clipboard operation
lockable-resources-plugin copied to clipboard

Provide option to not unlock resource when job is finished

Open bkhouri opened this issue 6 years ago • 1 comments

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

bkhouri avatar Jan 15 '19 16:01 bkhouri

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

jimklimov avatar Aug 01 '19 08:08 jimklimov

Duplicate to #253

mPokornyETM avatar Feb 07 '23 17:02 mPokornyETM