fix(Jenkinsfile): refs #6695 add credentials for Docker login in E2E stage
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Alex Moreno 2025-03-05 12:33:47 +01:00
parent aef1bd046a
commit b7f1ef3bd3
1 changed files with 5 additions and 3 deletions

8
Jenkinsfile vendored
View File

@ -108,6 +108,7 @@ pipeline {
} }
stage('E2E') { stage('E2E') {
environment { environment {
CREDS = credentials('docker-registry')
COMPOSE_PROJECT = "${PROJECT_NAME}-${env.BUILD_ID}" COMPOSE_PROJECT = "${PROJECT_NAME}-${env.BUILD_ID}"
COMPOSE_PARAMS = "-p ${env.COMPOSE_PROJECT} -f test/cypress/docker-compose.yml --project-directory ." COMPOSE_PARAMS = "-p ${env.COMPOSE_PROJECT} -f test/cypress/docker-compose.yml --project-directory ."
} }
@ -115,9 +116,10 @@ pipeline {
script { script {
sh 'rm junit/e2e-*.xml || true' sh 'rm junit/e2e-*.xml || true'
env.COMPOSE_TAG = PROTECTED_BRANCH.contains(env.CHANGE_TARGET) ? env.CHANGE_TARGET : 'dev' env.COMPOSE_TAG = PROTECTED_BRANCH.contains(env.CHANGE_TARGET) ? env.CHANGE_TARGET : 'dev'
withDockerRegistry([credentialsId: 'docker-registry', url: "https://${env.REGISTRY}" ]) {
sh "docker-compose ${env.COMPOSE_PARAMS} up -d" sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY'
} sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs') def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs')
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") { image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") {
sh 'sh test/cypress/cypressParallel.sh 2' sh 'sh test/cypress/cypressParallel.sh 2'