From 04543c839721e73af10cd752722801c461eb0867 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 3 Mar 2025 12:53:13 +0100 Subject: [PATCH] ci: refs #8698 try lastSuccessfulBuild --- Jenkinsfile | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fb2fecb68..bb67bdfa0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,6 +9,26 @@ def BRANCH_ENV = [ beta: 'production' ] +def searchFiles = { searchString -> + def searchPath = "src/pages" + + // Buscar en todos los archivos .vue dentro de src/pages + def matchingFiles = sh( + script: "grep -rl '${searchString}' ${searchPath} || true", + returnStdout: true + ).trim().split("\n") + + // Filtrar por si la salida está vacía + matchingFiles = matchingFiles.findAll { it.trim() } + + // Extraer solo el tercer segmento del path + def extractedFolders = matchingFiles.collect { "test/cypress/integration/" + it.split("/")[2] + "/**/*.spec.js" }.unique() + + echo "Carpetas donde se encontró '${searchString}': ${extractedFolders}" + return extractedFolders +} + + node { stage('Setup') { env.NODE_ENV = BRANCH_ENV[env.BRANCH_NAME] ?: 'dev' @@ -241,21 +261,3 @@ pipeline { } } -def searchFiles = { searchString -> - def searchPath = "src/pages" - - // Buscar en todos los archivos .vue dentro de src/pages - def matchingFiles = sh( - script: "grep -rl '${searchString}' ${searchPath} || true", - returnStdout: true - ).trim().split("\n") - - // Filtrar por si la salida está vacía - matchingFiles = matchingFiles.findAll { it.trim() } - - // Extraer solo el tercer segmento del path - def extractedFolders = matchingFiles.collect { "test/cypress/integration/" + it.split("/")[2] + "/**/*.spec.js" }.unique() - - echo "Carpetas donde se encontró '${searchString}': ${extractedFolders}" - return extractedFolders -}