Add mail notification to Jenkinsfile
testing/og-dhcp-API/pipeline/head There was a failure building this commit Details

testing
Nicolas Arenas 2024-10-01 12:08:05 +02:00
parent 458930c7cb
commit 110f7e3370
1 changed files with 18 additions and 1 deletions

View File

@ -30,7 +30,7 @@ pipeline {
echo "$QINDEL_PASS" | sudo -S bash -c "echo '$new_ip api-test' >> /etc/hosts"
echo "IP: $new_ip"
curl -f -L -X 'GET' -H 'accept: application/json' "http://api-test/opengnsys3/rest/dhcp/subnets/"
'''
'''
}
}
}
@ -48,4 +48,21 @@ pipeline {
}
}
}
post {
always {
script {
def commiterEmail = sh(script: 'git log -1 --pretty=format:%ae', returnStdout: true).trim()
emailext(
to: "${committerEmail}",
subject: "Jenkins Job Completed: ${env.JOB_NAME} #${env.BUILD_NUMBER}",
body: """
El job '${env.JOB_NAME}' con número de build ${env.BUILD_NUMBER} ha finalizado.
Estado: ${currentBuild.currentResult}
Revisa los detalles del build en: ${env.BUILD_URL}
"""
}
}
}
}