Optimization of Pipeline Lock Strategy for Parallel Environment Deployments

I am managing a Groovy-based Jenkins Scripted Pipeline for a microservice that deploys to multiple environments (DEV, ACC, PROD). We currently use a global lock at the start of the pipeline logic to prevent concurrent execution.

  • Jenkins Version: 2.319.1

  • Key Plugin: Lockable Resources Plugin

  • Environment: Kubernetes-based agents (podTemplate)

Current Implementation: Currently, our pipeline is wrapped in a global lock like this:

You missed to add the pipeline code