From 03b12f8beb94d10047464691fcfc17f4ad9906d9 Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Thu, 12 Feb 2026 16:14:23 +0200 Subject: [PATCH] up1 --- project2/jenkinsfile | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/project2/jenkinsfile b/project2/jenkinsfile index 940cc21..e986e24 100644 --- a/project2/jenkinsfile +++ b/project2/jenkinsfile @@ -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'" } } } \ No newline at end of file