Files
rock-paper-scissors/Jenkinsfile

51 lines
1.4 KiB
Plaintext
Raw Normal View History

pipeline {
agent any
tools {
maven 'maven-3.9'
}
stages {
stage('Compilation') {
steps {
echo "Compilation du projet..."
sh 'mvn clean compile'
}
}
stage('Tests') {
steps {
echo "Exécution des tests..."
sh 'mvn test'
}
post {
always {
// Publier les résultats de tests JUnit dans Jenkins
junit 'target/surefire-reports/*.xml'
}
}
}
stage('Packaging') {
steps {
echo "Packaging de l'application (sans exécuter les tests)..."
sh 'mvn package -DskipTests'
}
}
2025-11-23 19:16:50 +01:00
stage('Déploiement DEBUG') {
steps {
2025-11-23 19:09:09 +01:00
sh '''
2025-11-23 19:16:50 +01:00
echo "=== Debug du démarrage Spring Boot sur 8081 (foreground) ==="
ls -lh target
2025-11-23 19:09:09 +01:00
2025-11-23 19:16:50 +01:00
JAR_FILE=$(ls target/*.jar | head -n 1)
echo "Jar sélectionné: $JAR_FILE"
2025-11-23 19:09:09 +01:00
2025-11-23 19:16:50 +01:00
echo "Version de Java:"
which java || echo "java introuvable"
java -version || true
echo "Lancement de l'application en foreground (sans nohup)..."
java -jar "$JAR_FILE" --server.port=8081
2025-11-23 19:09:09 +01:00
'''
}
}
}
}