-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
47 lines (43 loc) · 1.17 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
pipeline {
agent any
environment {
PROJECT_NAME = "Java Rest API"
}
stages {
stage('Git'){
steps{
echo "Clone ${PROJECT_NAME} Stage";
git 'https://github.com/mixaverros88/dockerized-java-api'
}
}
stage('Mvn'){
steps{
echo "Compile ${PROJECT_NAME} Stage";
bat 'build.bat'
}
}
stage('Docker'){
steps{
echo "Build image ${PROJECT_NAME} Stage";
bat 'winpty docker run -it -p 80:8080 mixaverross88/java-restfull-api:1.1'
}
}
stage('Deploy'){
steps{
echo "Deploy ${PROJECT_NAME} in Tomcat";
deploy adapters: [tomcat9(credentialsId: '38635434-9f3c-40e9-b2fb-acf2d792224c', path: '', url: 'http://localhost:8080/')], contextPath: 'demorest', war: '**/*.war'
}
}
}
post{
always {
junit '**/*.xml'
}
success{
echo "The Pipeline for ${PROJECT_NAME} success"
}
failure {
echo "The Pipeline for ${PROJECT_NAME} fail"
}
}
}