This commit is contained in:
18
Jenkinsfile
vendored
18
Jenkinsfile
vendored
@@ -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: $!"
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user