From c428e2d341bc662c65f1f60b2ab15be422413742 Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Thu, 12 Feb 2026 15:10:36 +0200 Subject: [PATCH] Test1 --- project1/jenkinsfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/project1/jenkinsfile b/project1/jenkinsfile index 4eb6446..76365bd 100644 --- a/project1/jenkinsfile +++ b/project1/jenkinsfile @@ -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)." + } + } } \ No newline at end of file