forked from anujdevopslearn/MavenBuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
27 lines (21 loc) · 771 Bytes
/
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
node(){
def sonarHome = tool name: 'SonarScanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation'
stage('Code Checkout'){
checkout changelog: false, poll: false, scm: scmGit(branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: 'GitHubCreds', url: 'https://github.com/anujdevopslearn/MavenBuild']])
}
stage('Build Automation'){
sh """
ls -lart
mvn clean install
ls -lart target
"""
}
stage('Code Scan'){
withSonarQubeEnv(credentialsId: 'SonarQubeCreds') {
sh "${sonarHome}/bin/sonar-scanner"
}
}
stage('Code Deployment'){
deploy adapters: [tomcat9(credentialsId: 'TomcatCreds', path: '', url: 'http://54.197.62.94:8080/')], contextPath: 'Planview', onFailure: false, war: 'target/*.war'
}
}