Test1
This commit is contained in:
@@ -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)."
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user