43 lines
1.5 KiB
Plaintext
43 lines
1.5 KiB
Plaintext
pipeline {
|
|
agent any
|
|
|
|
stages {
|
|
stage('Checkout') {
|
|
steps {
|
|
checkout scm
|
|
}
|
|
}
|
|
|
|
stage('Lint Check') {
|
|
steps {
|
|
script {
|
|
dir('project2') {
|
|
sh "docker build -t lint-test ."
|
|
sh "docker run --rm lint-test python -m py_compile famousquotes.py"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Build & Run') {
|
|
steps {
|
|
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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
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'"
|
|
}
|
|
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'"
|
|
}
|
|
}
|
|
} |