ci: refs #8698 try lastSuccessfulBuild
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
d302ee58c0
commit
ca020fff80
|
@ -98,24 +98,24 @@ pipeline {
|
|||
lastSuccessfulBuild = lastSuccessfulBuild.previousBuild
|
||||
}
|
||||
echo "lastSuccessfulBuild ${lastSuccessfulBuild.changesets}"
|
||||
// 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 "Archivos modificados: ${change.affectedPaths}"
|
||||
// echo "Commit: ${change.commitId}"
|
||||
// }
|
||||
// }
|
||||
if (lastSuccessfulBuild != null && lastSuccessfulBuild.changesets.size() > 0) {
|
||||
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 "Archivos modificados: ${change.affectedPaths}"
|
||||
echo "Commit: ${change.commitId}"
|
||||
}
|
||||
}
|
||||
|
||||
// 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}"
|
||||
// }
|
||||
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