forked from RAMKIDEVOPS/CI-with-Jenkins-in-AWS-Demo
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathJenkinsfile_Linux
29 lines (28 loc) · 1.22 KB
/
Jenkinsfile_Linux
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
pipeline {
agent any
stages {
stage('build') {
steps {
sh 'mvn package'
}
}
stage('Sonarqube analysis') {
steps {
withSonarQubeEnv('sonar') {
sh "mvn sonar:sonar"
}
}
}
stage('Publish artifact to Nexus repository') {
steps {
nexusPublisher nexusInstanceId: '1234', nexusRepositoryId: 'myNexusRepo', packages: [[$class: 'MavenPackage', mavenAssetList: [[classifier: '', extension: '', filePath: '/var/lib/jenkins/workspace/sonar_nexus_tomcat_pipeline_job/project/target/ProjectIGI-1.1.war']], mavenCoordinate: [artifactId: 'projectIGI', groupId: 'com.ci.jenkins', packaging: 'war', version: '1.${BUILD_NUMBER}']]]
}
}
/*stage('Deploy artifact from Nexus to Tomcat container') {
steps {
//sh "curl -u sachin:sachin -o C:/apache-tomcat-8.5.55/webapps/myapp.war http://xx.xxx.xx.xxx:8081/nexus/repository/myNexusRepo/com/ci/jenkins/projectIGI/1.${BUILD_NUMBER}/projectIGI-1.${BUILD_NUMBER}.war"
sh "curl -u sachin:sachin --upload-file http://xx.xxx.xx.xxx:8081/repository/myNexusRepo/com/ci/jenkins/projectIGI/1.${BUILD_NUMBER}/projectIGI-1.${BUILD_NUMBER}.war http://xx.xxx.xx.xx:8080//manager/deploy?path=/myapp"
}
}*/
}
}