diff --git a/Jenkinsfile b/Jenkinsfile index 7d3acd305..a2041b1ea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -90,24 +90,26 @@ pipeline { lastSuccessfulBuild = lastSuccessfulBuild.previousBuild } - if (lastSuccessfulBuild != null && lastSuccessfulBuild.changesets.size() > 0) { - echo "lastSuccessfulBuild ${lastSuccessfulBuild} ${lastSuccessfulBuild.changesets.size()}" - // Extraer el commit del build exitoso desde el changelog - def lastCommitHash = "" - for (changeSet in lastSuccessfulBuild.changesets) { - for (change in changeSet.items) { - echo "Autor: ${change.author}" - echo "Comentario: ${change.comment}" - echo "Archivos modificados: ${change.affectedPaths}" - // echo "Commit: ${change.commitId}" + def lastCommitHash = "" + + if (lastSuccessfulBuild) { + def rawBuild = lastSuccessfulBuild.getRawBuild() // Convertimos a hudson.model.Run + + if (rawBuild.changeSets?.size() > 0) { + echo "lastSuccessfulBuild: #${lastSuccessfulBuild.number}, Changesets: ${rawBuild.changeSets.size()}" + + for (changeSet in rawBuild.changeSets) { + for (change in changeSet.items) { + echo "Archivos modificados: ${change.affectedPaths}" + echo "Commit: ${change.commitId}" + lastCommitHash = change.commitId // Tomamos el commit más reciente + } } } + } - if (lastCommitHash) { - echo "Último commit exitoso: ${lastCommitHash}" - } - } else { - lastCommitHash = sh(script: "git rev-parse origin/${env.CHANGE_TARGET}}", returnStdout: true).trim() + if (!lastCommitHash) { + lastCommitHash = sh(script: "git rev-parse origin/${env.CHANGE_TARGET}", returnStdout: true).trim() echo "Hash obtenido con git: ${lastCommitHash}" } } diff --git a/test/cypress/integration/outLogin/login.spec.js b/test/cypress/integration/login/login.spec.js similarity index 100% rename from test/cypress/integration/outLogin/login.spec.js rename to test/cypress/integration/login/login.spec.js diff --git a/test/cypress/integration/outLogin/logout.spec.js b/test/cypress/integration/login/logout.spec.js similarity index 100% rename from test/cypress/integration/outLogin/logout.spec.js rename to test/cypress/integration/login/logout.spec.js diff --git a/test/cypress/integration/outLogin/recoverPassword.spec.js b/test/cypress/integration/login/recoverPassword.spec.js similarity index 100% rename from test/cypress/integration/outLogin/recoverPassword.spec.js rename to test/cypress/integration/login/recoverPassword.spec.js diff --git a/test/cypress/integration/outLogin/twoFactor.spec.js b/test/cypress/integration/login/twoFactor.spec.js similarity index 100% rename from test/cypress/integration/outLogin/twoFactor.spec.js rename to test/cypress/integration/login/twoFactor.spec.js