Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Docker 如何在不同的代理上运行Jenkins parallel cypress?_Docker_Jenkins_Testing_Frontend_Cypress - Fatal编程技术网

Docker 如何在不同的代理上运行Jenkins parallel cypress?

Docker 如何在不同的代理上运行Jenkins parallel cypress?,docker,jenkins,testing,frontend,cypress,Docker,Jenkins,Testing,Frontend,Cypress,我在同一个奴隶身上运行Jenkins的parallel cypress 我想更改并行阶段,以便每个阶段将在不同的从属设备上运行,我如何才能做到这一点 例如: 在从机1上运行“cypress tester A” 在从机2上运行“cypress tester B” 在从机3上运行“cypress tester C” 这是我当前的文件: pipeline { options { timeout(time: 15, unit: 'MINUTES') } agent { docker {

我在同一个奴隶身上运行Jenkins的parallel cypress

我想更改并行阶段,以便每个阶段将在不同的从属设备上运行,我如何才能做到这一点

例如:

在从机1上运行“cypress tester A”

在从机2上运行“cypress tester B”

在从机3上运行“cypress tester C”

这是我当前的文件:

pipeline {
options {
    timeout(time: 15, unit: 'MINUTES')
}
agent {
    docker {
        image 'cypress/base:12.18.2'
        label 'slave-1'
    }
}
parameters {
    string(defaultValue: 'master', description: 'Branch name', name: 'branchName')
}

stages {
    stage('build') {
        steps {
            echo 'Running build...'
            sh 'npm ci'
            sh 'npm run cy:verify'
        }
    }

    stage('cypress parallel tests') {
        environment {
            CYPRESS_RECORD_KEY = 'MY_CYPRESS_RECORD_KEY'
            CYPRESS_trashAssetsBeforeRuns = 'false'
        }
        parallel {
            stage('cypress tester A') {
                steps {
                    echo "Running build ${env.BUILD_ID}"
                    sh "npm run cypress:run"
                }
            }
            stage('cypress tester B') {
                steps {
                    echo "Running build ${env.BUILD_ID}"
                    sh "npm run cypress:run"
                }
            }
            stage('cypress tester C') {
                steps {
                    echo "Running build ${env.BUILD_ID}"
                    sh "npm run cypress:run"
                }
            }
        }

    }
}

post {
    always {
        cleanWs(deleteDirs: true)
        echo 'Tests are finished'
    }
}
}

cypress:run
命令是:

cypress run --record --parallel --config videoUploadOnPasses=false --ci-build-id $BUILD_TAG