Updated notify script
parent
e5204ffe40
commit
da9dfe39af
|
@ -1,5 +1,8 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [0.1.1] - 2025-03-26
|
||||||
|
### Changed
|
||||||
|
- email notifications to opengnsys@qindel.com and commiter doer
|
||||||
## [0.1.0] - 2025-03-17
|
## [0.1.0] - 2025-03-17
|
||||||
### Initial Release
|
### Initial Release
|
||||||
- Primera versión de la librería compartida
|
- Primera versión de la librería compartida
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
def call(String recipients) {
|
def call() {
|
||||||
// Determina el estado del build
|
// Determina el estado del build
|
||||||
def buildStatus = currentBuild.currentResult ?: 'SUCCESS'
|
def buildStatus = currentBuild.currentResult ?: 'SUCCESS'
|
||||||
|
|
||||||
|
@ -7,6 +7,13 @@ def call(String recipients) {
|
||||||
def body = """El build ${env.BUILD_NUMBER} del trabajo '${env.JOB_NAME}' ha finalizado con estado: ${buildStatus}.
|
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}"""
|
Puedes ver los detalles aquí: ${env.BUILD_URL}"""
|
||||||
|
|
||||||
|
// Intenta obtener el usuario que ha lanzado el job
|
||||||
|
def userId = currentBuild.getBuildCauses()?.find { it._class == 'hudson.model.Cause$UserIdCause' }?.userId
|
||||||
|
def userEmail = userId ? "${userId}@qindel.com" : "opengnsysy@qindel.com"
|
||||||
|
|
||||||
mail to: recipients, subject: subject, body: body
|
// Dirección de correo a copiar siempre
|
||||||
|
def ccEmail = "opengnsysy@qindel.com"
|
||||||
|
|
||||||
|
// Envía el correo
|
||||||
|
mail to: "${userEmail}", cc: "${ccEmail}", subject: subject, body: body
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue