up1
This commit is contained in:
@@ -24,8 +24,8 @@ pipeline {
|
||||
script {
|
||||
dir('project2') {
|
||||
sh "docker build -t quotes-app ."
|
||||
// ADAUGĂM --dns 8.8.8.8 pentru a rezolva eroarea de conexiune API
|
||||
sh "docker run --rm --dns 8.8.8.8 -e QUOTE_API_URL='https://api.quotable.io/random' quotes-app"
|
||||
// --network host rezolvă DNS în WSL
|
||||
sh "docker run --rm --network host -e QUOTE_API_URL='https://api.quotable.io/random' quotes-app"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,26 +34,10 @@ pipeline {
|
||||
|
||||
post {
|
||||
success {
|
||||
script {
|
||||
def discordUrl = 'https://discord.com/api/webhooks/1471492658336891013/T5s6ZKZjjDMHXc3k3jjZdk6m5EV12bKF1wda9d5I_gZJrsDZQ1m1m078IiLJwk38mqa'
|
||||
def payload = """
|
||||
{
|
||||
"content": "✅ **SUCCESS: Famous Quotes App**\\nBuild-ul #${env.BUILD_NUMBER} a trecut cu succes! Aplicația a rulat corect."
|
||||
}
|
||||
"""
|
||||
sh "curl -X POST -H 'Content-Type: application/json' -d '${payload.trim()}' '${discordUrl}'"
|
||||
}
|
||||
sh "curl -X POST -H 'Content-Type: application/json' -d '{\"content\": \"✅ **SUCCESS**: Build #${env.BUILD_NUMBER} a trecut! Aplicația a rulat corect.\"}' 'https://discord.com/api/webhooks/1471492658336891013/T5s6ZKZjjDMHXc3k3jjZdk6m5EV12bKF1wda9d5I_gZJrsDZQ1m1m078IiLJwk38mqa'"
|
||||
}
|
||||
failure {
|
||||
script {
|
||||
def discordUrl = 'https://discord.com/api/webhooks/1471492658336891013/T5s6ZKZjjDMHXc3k3jjZdk6m5EV12bKF1wda9d5I_gZJrsDZQ1m1m078IiLJwk38mqa'
|
||||
def payload = """
|
||||
{
|
||||
"content": "❌ **FAILED: Famous Quotes App**\\nBuild-ul #${env.BUILD_NUMBER} a eșuat. Verifică log-urile din Jenkins!"
|
||||
}
|
||||
"""
|
||||
sh "curl -X POST -H 'Content-Type: application/json' -d '${payload.trim()}' '${discordUrl}'"
|
||||
}
|
||||
sh "curl -X POST -H 'Content-Type: application/json' -d '{\"content\": \"❌ **FAILED**: Build #${env.BUILD_NUMBER} a eșuat. Verifică log-urile!\"}' 'https://discord.com/api/webhooks/1471492658336891013/T5s6ZKZjjDMHXc3k3jjZdk6m5EV12bKF1wda9d5I_gZJrsDZQ1m1m078IiLJwk38mqa'"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user