-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
50 lines (50 loc) · 1.11 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
pipeline {
agent {
label 'Maven-Build-Env' // Use the Maven slave node for this pipeline
}
stages {
stage('Validate Project') {
steps {
sh 'mvn validate'
}
}
stage('Unit Test'){
steps {
sh 'mvn test'
}
}
stage('Integration Test'){
steps {
sh 'mvn verify -DskipUnitTests'
}
}
stage('App Packaging'){
steps {
sh 'mvn package'
}
}
stage ('Checkstyle Code Analysis'){
steps {
sh 'mvn checkstyle:checkstyle'
}
}
stage('SonarQube Inspection') {
steps {
sh """mvn sonar:sonar \
-Dsonar.projectKey=Maven-JavaWebApp \
-Dsonar.host.url=http://172.31.5.173:9000 \
-Dsonar.login=ed7f1ae74cf8b693cadbd47043d4b9ed5ef50913"""
}
}
stage("Upload Artifact To Nexus"){
steps{
sh 'mvn deploy'
}
post {
success {
echo 'Successfully Uploaded Artifact to Nexus Artifactory'
}
}
}
}
}