This commit is contained in:
Ionel Andrei Cataon
2026-02-12 15:10:36 +02:00
parent e464c1ade7
commit c428e2d341

View File

@@ -27,4 +27,23 @@ pipeline {
} }
} }
} }
post {
failure {
script {
def discordUrl = "https://discord.com/api/webhooks/1471492658336891013/T5s6ZKZjJjDMHXc3k3jjZdk6m5EV12bKF1wda9d5I_gZJrsDZQ1m1m078IiLJWK38mqa"
def payload = """
{
"content": "🚨 **ALERTA JENKINS** 🚨\\n**Proiect:** ${env.JOB_NAME}\\n**Status:** FAILED ❌\\n**Build Nr:** ${env.BUILD_NUMBER}\\n**Detalii:** ${env.BUILD_URL}"
}
"""
// Trimitem notificarea folosind curl
sh "curl -H 'Content-Type: application/json' -d '${payload}' ${discordUrl}"
}
}
success {
echo "Totul a functionat perfect! Nu trimitem notificare pe Discord (ca sa nu facem spam)."
}
}
} }