feat: add email notifications to CI/CD pipeline
- Send success/failure notifications to soufiane.baali99@gmail.com - Include build details: project, build number, environment, duration - HTML formatted emails with links to build logs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
bee7c7f93c
commit
c4ac79ef8b
32
Jenkinsfile
vendored
32
Jenkinsfile
vendored
|
|
@ -294,6 +294,22 @@ pipeline {
|
||||||
║ Tag : ${env.TAG.padRight(23)} ║
|
║ Tag : ${env.TAG.padRight(23)} ║
|
||||||
╚══════════════════════════════════════════╝
|
╚══════════════════════════════════════════╝
|
||||||
"""
|
"""
|
||||||
|
emailext(
|
||||||
|
to: 'soufiane.baali99@gmail.com',
|
||||||
|
subject: "✅ Pipeline Frontend SUCCÈS - ${env.ENV}",
|
||||||
|
body: """
|
||||||
|
<h2 style="color: green;">✅ Pipeline Frontend terminé avec succès</h2>
|
||||||
|
<table border="1" cellpadding="10" style="border-collapse: collapse;">
|
||||||
|
<tr><td><strong>Projet</strong></td><td>${env.JOB_NAME}</td></tr>
|
||||||
|
<tr><td><strong>Build</strong></td><td>#${env.BUILD_NUMBER}</td></tr>
|
||||||
|
<tr><td><strong>Environnement</strong></td><td>${env.ENV}</td></tr>
|
||||||
|
<tr><td><strong>Image</strong></td><td>${IMAGE_NAME}:${env.TAG}</td></tr>
|
||||||
|
<tr><td><strong>Durée</strong></td><td>${currentBuild.durationString}</td></tr>
|
||||||
|
</table>
|
||||||
|
<p>🔗 <a href="${env.BUILD_URL}">Voir les détails du build</a></p>
|
||||||
|
""",
|
||||||
|
mimeType: 'text/html'
|
||||||
|
)
|
||||||
}
|
}
|
||||||
failure {
|
failure {
|
||||||
echo """
|
echo """
|
||||||
|
|
@ -304,6 +320,22 @@ pipeline {
|
||||||
║ Vérifiez les logs pour plus de détails ║
|
║ Vérifiez les logs pour plus de détails ║
|
||||||
╚══════════════════════════════════════════╝
|
╚══════════════════════════════════════════╝
|
||||||
"""
|
"""
|
||||||
|
emailext(
|
||||||
|
to: 'soufiane.baali99@gmail.com',
|
||||||
|
subject: "❌ Pipeline Frontend ÉCHEC - ${env.ENV}",
|
||||||
|
body: """
|
||||||
|
<h2 style="color: red;">❌ Pipeline Frontend a échoué</h2>
|
||||||
|
<table border="1" cellpadding="10" style="border-collapse: collapse;">
|
||||||
|
<tr><td><strong>Projet</strong></td><td>${env.JOB_NAME}</td></tr>
|
||||||
|
<tr><td><strong>Build</strong></td><td>#${env.BUILD_NUMBER}</td></tr>
|
||||||
|
<tr><td><strong>Environnement</strong></td><td>${env.ENV}</td></tr>
|
||||||
|
<tr><td><strong>Durée</strong></td><td>${currentBuild.durationString}</td></tr>
|
||||||
|
</table>
|
||||||
|
<p>🔗 <a href="${env.BUILD_URL}">Voir les logs du build</a></p>
|
||||||
|
<p>🔗 <a href="${env.BUILD_URL}console">Console Output</a></p>
|
||||||
|
""",
|
||||||
|
mimeType: 'text/html'
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user