Add build status

main
Nicolas Arenas 2025-03-18 01:03:56 +01:00
parent e83ec1d142
commit 84e6d988cc
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
def call(String recipients) {
// Determina el estado del build
def buildStatus = currentBuild.currentResult ?: 'SUCCESS'
// Define el asunto y el cuerpo del correo según el estado
def subject = "[Jenkins] ${buildStatus}: ${env.JOB_NAME} #${env.BUILD_NUMBER}"
def body = """El build ${env.BUILD_NUMBER} del trabajo '${env.JOB_NAME}' ha finalizado con estado: ${buildStatus}.
Puedes ver los detalles aquí: ${env.BUILD_URL}"""
// Enviar correo
emailext(
to: recipients,
subject: subject,
body: body
)
}