forked from Sumyak-Jain/CI-CD-Pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.groovy
44 lines (41 loc) · 1.4 KB
/
script.groovy
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
pipeline {
agent any
stages {
stage ('Git-Checkout') {
steps{
git credentialsId: 'e6757c46-0750-4ab1-8cd4-c569efcbbdb1', url: 'https://github.com/sumyak/CI-CD-Pipeline.git'
echo "Checkout successful";
}
}
stage ('Compile') {
steps{
bat label: '', script: 'mvn compile'
echo "test successful";
}
}
stage ('Build') {
steps{
bat label: '', script: 'mvn clean'
bat label: '', script: 'mvn package'
echo "build successful";
}
}
stage ('Test') {
steps{
bat label: '', script: 'mvn test'
echo "test successful";
}
}
stage ('Deploy') {
steps{
deploy adapters: [tomcat9(credentialsId: '0ec60cd3-c147-467b-bc23-ceabd7954e28', path: '', url: 'http://localhost:8081/')], contextPath: 'jenkins_calci', onFailure: false, war: '**/*.war'
echo "Deploy successful";
}
}
stage ('Monitor') {
steps{
echo "Now you can monitor!";
}
}
}
}