Files
rock-paper-scissors/Jenkinsfile
Maxime Pierront 33b24c62d4
Some checks failed
rock-paper-scissors/pipeline/pr-main There was a failure building this commit
rock-paper-scissors/pipeline/head There was a failure building this commit
Refactor InMemoryStatRepository initialization with default stats constant, make Application.main public, update Java version to 21 in pom.xml, and remove redundant Jenkinsfile configuration.
2025-11-23 01:12:37 +01:00

39 lines
1.2 KiB
Groovy

pipeline {
agent any
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'
}
}
stage('Déploiement') {
steps {
echo "Démarrage de l'application Spring Boot..."
// Arr\u00eater l'application si elle tourne d\u00e9j\u00e0 (pour ne pas dupliquer les instances)
sh 'pkill -f "java -jar" || echo "Aucune ancienne instance \u00e0 arr\u00eater"'
// D\u00e9marrer la nouvelle version en arri\u00e8re-plan
sh 'nohup java -jar target/*.jar --server.port=8081 &'
}
}
}
}