u2
This commit is contained in:
@@ -3,9 +3,7 @@ pipeline {
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
checkout scm
|
||||
}
|
||||
steps { checkout scm }
|
||||
}
|
||||
|
||||
stage('Lint Check') {
|
||||
@@ -24,8 +22,8 @@ pipeline {
|
||||
script {
|
||||
dir('project2') {
|
||||
sh "docker build -t 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"
|
||||
// Mapăm manual IP-ul pentru a sări peste problema de DNS
|
||||
sh "docker run --rm --add-host api.quotable.io:104.21.23.210 -e QUOTE_API_URL='https://api.quotable.io/random' quotes-app"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,10 +32,18 @@ pipeline {
|
||||
|
||||
post {
|
||||
success {
|
||||
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'"
|
||||
script {
|
||||
def msg = "✅ **SUCCESS**: Build #${env.BUILD_NUMBER} a trecut cu succes!"
|
||||
sh "echo '{\"content\": \"$msg\"}' > discord_success.json"
|
||||
sh "curl -X POST -H 'Content-Type: application/json' -d @discord_success.json 'https://discord.com/api/webhooks/1471492658336891013/T5s6ZKZjjDMHXc3k3jjZdk6m5EV12bKF1wda9d5I_gZJrsDZQ1m1m078IiLJwk38mqa'"
|
||||
}
|
||||
}
|
||||
failure {
|
||||
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'"
|
||||
script {
|
||||
def msg = "❌ **FAILED**: Build #${env.BUILD_NUMBER} a eșuat. Verifică DNS-ul sau codul!"
|
||||
sh "echo '{\"content\": \"$msg\"}' > discord_fail.json"
|
||||
sh "curl -X POST -H 'Content-Type: application/json' -d @discord_fail.json 'https://discord.com/api/webhooks/1471492658336891013/T5s6ZKZjjDMHXc3k3jjZdk6m5EV12bKF1wda9d5I_gZJrsDZQ1m1m078IiLJwk38mqa'"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user