小编Jp *_*ett的帖子

Jenkins管道抛出“ StackOverflowError:过多嵌套的闭包/函数”

我有以下内容Jenkinsfile

#!groovy

def projectPath = "${projectPath}"
def specPath = "${specPath}"
int numberOfRetries = "${NUM_OF_RETRIES}".toInteger()

def failure = true
def retryAmount = 0
def start = System.currentTimeMillis()

def getSpecName() {
    specPath.split("/")[-1].split(".")[0]
}

def getProjectPath() {
    projectPath.split("/")[-1]
}

def rmDocker() {
    def remove = sh script: "docker rm -f cypress_${getSpecName()}", returnStatus: true
}

stage("Cypress Setup") {
    node("Cypress") {
        rmDocker()
    }
}

stage("Cypress Run") {
    node("Cypress") {
        currentBuild.setDisplayName("${projectPath} - ${getSpecName()}")
        while (failure && retryAmount < numberOfRetries) {
            sh "docker pull dockreg.bluestembrands.com/cypresswithtests:latest" …
Run Code Online (Sandbox Code Playgroud)

groovy jenkins jenkins-pipeline

4
推荐指数
1
解决办法
1878
查看次数

标签 统计

groovy ×1

jenkins ×1

jenkins-pipeline ×1