add jenkins pipeline
This commit is contained in:
34
jenkinsfile
34
jenkinsfile
@@ -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
|
|
||||||
"""
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user