This commit is contained in:
Ionel Andrei Cataon
2026-02-18 15:36:30 +02:00
parent 5f9c47b95d
commit fda1f4777f

View File

@@ -1,40 +1,30 @@
pipeline {
agent any
tools {
maven 'MVN-WSL'
}
stages {
stage('Checkout') {
stage('Maven Build (WAR)') {
steps {
checkout scm
}
}
stage('Maven Analysis') {
steps {
sh 'mvn --version'
echo 'Maven a fost integrat cu succes în pipeline-ul de Python!'
}
}
stage('Build Docker Image') {
steps {
dir('proiect-nutritie') {
sh 'docker build -t dieta-app-jenkins .'
dir('proiect-nutritie-java') {
sh 'mvn clean package'
}
}
}
stage('Deploy') {
stage('Docker Build & Deploy (Tomcat)') {
steps {
dir('proiect-nutritie-java') {
sh 'docker build -t nutritie-java-war .'
sh '''
docker stop test-dieta || true
docker rm test-dieta || true
docker run -d -p 8085:5000 --name test-dieta dieta-app-jenkins
docker stop container-java || true
docker rm container-java || true
docker run -d -p 8086:8080 --name container-java nutritie-java-war
'''
}
}
}
}
}