-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
55 lines (42 loc) · 1.41 KB
/
Jenkinsfile
File metadata and controls
55 lines (42 loc) · 1.41 KB
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{
//Directives
agent any
tools {
maven 'maven'
}
stages {
// Specify various stage with in stages
// stage 1. Build
stage ('Build'){
steps {
sh 'mvn clean install package'
}
}
// Stage2 : Testing
stage ('Test'){
steps {
echo ' testing......'
}
}
stage ('Publish to Nexus') {
steps {
nexusArtifactUploader artifacts: [[artifactId: 'SrinathDevOpsLab', classifier: '', file: 'target/SrinathDevOpsLab-0.0.8-SNAPSHOT.war', type: 'war']], credentialsId: 'a9879a3a-bc92-42a8-8331-17b20a4a85fb', groupId: 'com.vinaysdevopslab', nexusUrl: '3.139.86.194:8081', nexusVersion: 'nexus3', protocol: 'http', repository: 'SrinathsDevOpsLab-SNAPSHOT', version: '0.0.8-SNAPSHOT'
}
}
// Stage3 : Testing
stage ('Deploy'){
steps {
echo ' deploying......'
}
}
// Stage3 : Publish the source code to Sonarqube
// stage ('Sonarqube Analysis'){
// steps {
// echo ' Source code published to Sonarqube for SCA......'
// withSonarQubeEnv('sonarqube'){ // You can override the credential to be used
// sh 'mvn sonar:sonar'
// }
// }
// }
}
}