Docker 如何在不同的代理上运行Jenkins parallel cypress?
我在同一个奴隶身上运行Jenkins的parallel cypress 我想更改并行阶段,以便每个阶段将在不同的从属设备上运行,我如何才能做到这一点 例如: 在从机1上运行“cypress tester A” 在从机2上运行“cypress tester B” 在从机3上运行“cypress tester C” 这是我当前的文件: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 {
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