This commit is contained in:
18
Jenkinsfile
vendored
18
Jenkinsfile
vendored
@@ -30,11 +30,19 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('Déploiement') {
|
stage('Déploiement') {
|
||||||
steps {
|
steps {
|
||||||
echo "Démarrage de l'application Spring Boot..."
|
sh '''
|
||||||
// Arr\u00eater l'application si elle tourne d\u00e9j\u00e0 (pour ne pas dupliquer les instances)
|
echo "PWD = $(pwd)"
|
||||||
sh 'pkill -f "java -jar" || echo "Aucune ancienne instance \u00e0 arr\u00eater"'
|
echo "Content of target/:"
|
||||||
// D\u00e9marrer la nouvelle version en arri\u00e8re-plan
|
ls -lh target || echo "No target directory"
|
||||||
sh 'nohup java -jar target/*.jar --server.port=8081 &'
|
|
||||||
|
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