add jenkins pipeline

This commit is contained in:
Vincent Guillet
2025-11-20 16:10:38 +01:00
parent 6ef5b998a4
commit 028bd80669

View File

@@ -24,7 +24,15 @@ pipeline {
stage('Maven Build') { stage('Maven Build') {
steps { steps {
dir('api') { dir('api') {
sh 'mvn compile' sh 'mvn clean compile'
}
}
}
stage('Maven Test') {
steps {
dir('api') {
sh 'mvn test'
} }
} }
} }
@@ -38,47 +46,27 @@ pipeline {
} }
} }
stage('Maven Test') {
steps {
dir('api') {
sh 'mvn test'
}
}
}
stage('Spring Docker Build') { stage('Spring Docker Build') {
steps { steps {
dir('api') { sh 'docker-compose build spring'
sh 'docker-compose build spring'
}
} }
} }
stage('Angular Docker Build') { stage('Angular Docker Build') {
steps { steps {
dir('client') { sh 'docker-compose build angular'
sh 'docker-compose build angular'
}
} }
} }
stage('Spring Deployment') { stage('Spring Deployment') {
steps { steps {
sh """ sh 'docker-compose up -d spring'
docker-compose stop spring
docker-compose rm spring
docker-compose up -d --no-recreate spring
"""
} }
} }
stage('Angular Deployment') { stage('Angular Deployment') {
steps { steps {
sh """ sh 'docker-compose up -d angular'
docker-compose stop angular
docker-compose rm angular
docker-compose up -d --no-recreate angular
"""
} }
} }
} }