Add build status
parent
e83ec1d142
commit
84e6d988cc
|
@ -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
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue