Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The nested block depth is 6 GroovyLint(NestedBlockDepth-42) #11

Open
VladFrost opened this issue May 23, 2024 · 0 comments
Open

The nested block depth is 6 GroovyLint(NestedBlockDepth-42) #11

VladFrost opened this issue May 23, 2024 · 0 comments

Comments

@VladFrost
Copy link

VladFrost commented May 23, 2024

Hello @darinpope
I'm trying to implement a Jenkins declarative pipeline with parallel stages, but I've run into an issue with the GroovyLint tool. It's complaining about The nested block depth is 6 GroovyLint(NestedBlockDepth-42). I've seen similar issues in certain parts of your library and was wondering if there's a way to manage this complexity across libraries? For example, can I delegate particular parts of the declarative pipeline like all constructions inside parallel block to a shared library so that the nested block depth isn't an issue?

image

Here is an example that I didn't find in your library.

Jenkinsfile:
parallel {
    executeStagesInParallel()
}

executeStagesInParallel.groovy:
void call() {
    stage('Stage a') {
        steps {
            echo env.STAGE_NAME
        }
    }
    stage('Stage b') {
        steps {
            echo env.STAGE_NAME
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant