refactor: refs #8698 update Jenkinsfile to log last successful build details and clean up commented code
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Alex Moreno 2025-02-28 14:59:54 +01:00
parent 28ae84a931
commit 95f9917dc2
1 changed files with 12 additions and 11 deletions

23
Jenkinsfile vendored
View File

@ -91,20 +91,21 @@ pipeline {
}
if (lastSuccessfulBuild != null) {
echo "lastSuccessfulBuild ${lastSuccessfulBuild}"
// 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}"
}
}
// 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}"
// }
// }
if (lastCommitHash) {
echo "Último commit exitoso: ${lastCommitHash}"
}
// if (lastCommitHash) {
// echo "Último commit exitoso: ${lastCommitHash}"
// }
} else {
lastCommitHash = sh(script: "git rev-parse origin/${env.CHANGE_TARGET}}", returnStdout: true).trim()
echo "Hash obtenido con git: ${lastCommitHash}"