ci: refs #6695 use TARGET_BRANCH #1466

Merged
alexm merged 27 commits from 6695-fix_CHANGE_TARGET into dev 2025-02-27 08:22:36 +00:00
1 changed files with 50 additions and 51 deletions
Showing only changes of commit 05994ba1dc - Show all commits

101
Jenkinsfile vendored
View File

@ -20,7 +20,6 @@ node {
PROTECTED_BRANCH = GIT_PROTECTED_BRANCH + ['main','beta']
TARGET_BRANCH = GIT_PROTECTED_BRANCH.find { it == env.CHANGE_TARGET } ?: "dev"
alexm marked this conversation as resolved
Review

contains mes simple, comilles simples en 'dev'

contains mes simple, comilles simples en 'dev'
echo TARGET_BRANCH
Outdated
Review

COMPOSE_TAG , defineixla en el stage E2E

COMPOSE_TAG , defineixla en el stage E2E
IS_PROTECTED_BRANCH = PROTECTED_BRANCH.contains(env.BRANCH_NAME)
IS_LATEST = ['master', 'main'].contains(env.BRANCH_NAME)
alexm marked this conversation as resolved Outdated
Outdated
Review

Ns si estava de antes

Ns si estava de antes
@ -80,56 +79,56 @@ pipeline {
sh 'pnpm install --prefer-offline'
}
}
// stage('Test') {
// when {
// expression { !IS_PROTECTED_BRANCH }
// }
// environment {
// NODE_ENV = ''
// CI = 'true'
// TZ = 'Europe/Madrid'
// }
// parallel {
// stage('Unit') {
// steps {
// sh 'pnpm run test:unit:ci'
// }
// post {
// always {
// junit(
// testResults: 'junit/vitest.xml',
// allowEmptyResults: true
// )
// }
// }
// }
// stage('E2E') {
// environment {
// CREDENTIALS = credentials('docker-registry')
// COMPOSE_PROJECT = "${PROJECT_NAME}-${env.BUILD_ID}"
// COMPOSE_PARAMS = "-p ${env.COMPOSE_PROJECT} -f test/cypress/docker-compose.yml --project-directory ."
// }
// steps {
// script {
// def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs')
// sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
// image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") {
// sh 'cypress run --browser chromium'
// }
// }
// }
// post {
// always {
// sh "docker-compose ${env.COMPOSE_PARAMS} down"
// junit(
// testResults: 'junit/e2e.xml',
// allowEmptyResults: true
// )
// }
// }
// }
// }
// }
stage('Test') {
when {
expression { !IS_PROTECTED_BRANCH }
}
environment {
NODE_ENV = ''
CI = 'true'
TZ = 'Europe/Madrid'
}
parallel {
stage('Unit') {
steps {
sh 'pnpm run test:unit:ci'
}
post {
always {
junit(
testResults: 'junit/vitest.xml',
allowEmptyResults: true
)
}
}
}
stage('E2E') {
environment {
CREDENTIALS = credentials('docker-registry')
COMPOSE_PROJECT = "${PROJECT_NAME}-${env.BUILD_ID}"
COMPOSE_PARAMS = "-p ${env.COMPOSE_PROJECT} -f test/cypress/docker-compose.yml --project-directory ."
}
steps {
script {
def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs')
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") {
sh 'cypress run --browser chromium'
Outdated
Review

Ficala en environment, si no no l'agafara

Ficala en environment, si no no l'agafara
}
}
}
post {
always {
sh "docker-compose ${env.COMPOSE_PARAMS} down -v"
junit(
testResults: 'junit/e2e.xml',
allowEmptyResults: true
)
Review

Vols -v o era per a depurar?

Vols `-v` o era per a depurar?
}
}
}
}
}
stage('Build') {
when {
expression { IS_PROTECTED_BRANCH }