Add guide
All checks were successful
rock-paper-scissors/pipeline/head This commit looks good

This commit is contained in:
Maxime Pierront
2025-11-23 19:09:09 +01:00
parent e93481c91f
commit e57896fd1e

18
Jenkinsfile vendored
View File

@@ -30,11 +30,19 @@ pipeline {
}
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 &'
sh '''
echo "PWD = $(pwd)"
echo "Content of target/:"
ls -lh target || echo "No target directory"
echo "Which java?"
which java || echo "java NOT in PATH"
java -version || echo "java command failed"
echo "Trying to start app..."
nohup java -jar target/*.jar --server.port=8081 > app.log 2>&1 &
echo "PID started: $!"
'''
}
}
}