forked from ReyazShaik/devopsscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
47 lines (47 loc) · 1.95 KB
/
Jenkinsfile
File metadata and controls
47 lines (47 loc) · 1.95 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
pipeline {
agent any
stages {
stage('Checkout') {
steps {
git 'https://github.com/ReyazShaik/java-project-maven-new.git'
}
}
stage('Compile') {
steps {
sh 'mvn compile'
}
}
stage('Test') {
steps {
sh 'mvn test'
}
}
stage('SonarQube Scanning') {
steps {
withSonarQubeEnv('SonarQube') {
sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar'
}
}
}
stage('Artifacts') {
steps {
sh 'mvn clean package'
}
}
stage('Deploy to Tomcat') {
steps {
deploy adapters: [tomcat9(credentialsId: 'tomcatcreds', path: '', url: 'http://43.205.95.19:8080/')], contextPath: 'myapp', war: '**/*.war'
}
}
stage('Nexus') {
steps {
nexusArtifactUploader artifacts: [[artifactId: 'myapp', classifier: '', file: 'target/myapp.war', type: '.war']], credentialsId: 'nexus', groupId: 'in.reyaz', nexusUrl: '3.6.41.43:8081', nexusVersion: 'nexus3', protocol: 'http', repository: 'hotstar', version: '8.3.3-SNAPSHOT'
}
}
stage('Uploading to S3') {
steps {
s3Upload consoleLogLevel: 'INFO', dontSetBuildResultOnFailure: false, dontWaitForConcurrentBuildCompletion: false, entries: [[bucket: 'jen-project-arti/', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: false, noUploadOnFailure: false, selectedRegion: 'ap-south-1', showDirectlyInBrowser: false, sourceFile: '**/*.war', storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: true]], pluginFailureResultConstraint: 'FAILURE', profileName: 's3creds', userMetadata: []
}
}
}
}