-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
55 lines (54 loc) · 1.29 KB
/
Jenkinsfile
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
pipeline {
agent any
options {
// Keep the 10 most recent builds
buildDiscarder(logRotator(numToKeepStr:'10'))
}
tools {
maven 'Maven_3.8.6'
jdk 'Jdk_11'
}
stages {
stage ('Initialize') {
steps {
//echo "${GIT_BRANCH}"
echo "${env.GIT_BRANCH}"
}
}
stage ('Stop Containers') {
steps {
bat 'docker compose down'
}
}
stage ('Test') {
steps {
bat 'mvn -Dmaven.test.failure.ignore=true test'
}
post {
success {
junit 'target/surefire-reports/**/*.xml'
}
}
}
stage ('Build') {
steps {
bat 'mvn -Dskip.tests=true package'
}
}
stage ('Start Containers') {
steps {
bat 'docker compose up -d --build'
}
}
stage('Finalize') {
steps {
bat 'echo "Finalizing"'
}
post{
always {
mail bcc: '', body: 'Pipeline has been succesfully executed ', cc: '', from: 'ahmet.karabas@capgemini.com', replyTo: 'ahmet.karabas@capgemini.com', subject: 'Pipeline has been succesfully executed ', to: 'ahmet.karabas@capgemini.com'
}
}
}
}
}