-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipeline.txt
41 lines (38 loc) · 989 Bytes
/
pipeline.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
pipeline {
agent any
environment {
DOCKER_IMAGE_NAME = 'notification-service'
DOCKER_COMPOSE_FILE = 'docker-compose.yml'
}
stages {
stage('Checkout') {
steps {
git branch: 'main', url: 'https://github.com/rzabson/shop.git'
}
}
stage('Build JAR') {
steps {
script {
// Build the JAR file using Maven
sh 'mvn -f notification-service/pom.xml clean package'
}
}
}
stage('Deploy with Docker Compose') {
steps {
script {
// Use Docker Compose to deploy the services
sh "docker-compose up -d notification-service"
}
}
}
}
post {
success {
echo 'Deployment successful!'
}
failure {
echo 'Deployment failed!'
}
}
}