Jenkinsfile嵌套阶段抛出错误

Gra*_*y D 3 jenkins jenkins-pipeline

我有以下Jenkinsfile,我相信它已正确设置。我以https://jenkins.io/doc/book/pipeline/syntax/#sequential-stages为例,但由于某种原因,当我在jenkins中运行此程序时,

WorkflowScript:11:未知的阶段部分“阶段”。从版本0.5开始,阶段中的步骤必须在步骤块中

有人可以告诉我我想念什么或做错什么吗?

pipeline {
    agent {label 'windows'}

    stages {
        stage('Quick Build') {
            steps {
                echo 'Building'
            }
        }
        stage('Deploy to Dev') {
            // when {
            //     branch 'develop' 
            // }
            stages {
                stage('Building Distributable Package') {
                    steps {
                        echo 'Building'
                    }
                }
                stage('Archiving Package') {
                    steps {
                        echo 'Archiving Aritfacts'
                        archiveArtifacts artifacts: '/*.zip', fingerprint: true
                    }
                }
                stage('Deploying Dev') {
                    steps {
                        echo 'Deploying'
                        timeout(time:3, unit:'DAYS') {
                            input message: "Approve build?"
                        }
                    }
                }
            }

        }
        stage('Deploy to Test') {
            when {
                branch 'develop' 
            }
            steps {
                echo 'deploying..'
                timeout(time:3, unit:'DAYS') {
                    input message: "Approve build?"
                }
            }
        }
        stage('Deploy to Prod') {
            when {
                branch 'release' 
            }
            steps {
                timeout(time:3, unit:'DAYS') {
                    input message: "Deploy to Prod?"
                }
                echo 'Deploying....'
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

提前致谢!

Gra*_*y D 5

最终成为2.107.3。版本中的问题。升级到2.121.2后,此功能开始起作用。