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
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
28ae84a931
commit
95f9917dc2
|
@ -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}"
|
||||
|
|
Loading…
Reference in New Issue