-
Notifications
You must be signed in to change notification settings - Fork 958
Expand file tree
/
Copy pathjenkins sample
More file actions
41 lines (39 loc) · 1.21 KB
/
jenkins sample
File metadata and controls
41 lines (39 loc) · 1.21 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
node{
def mavenHome = tool name: 'maven3.8.5'
stage('1.Clone'){
git branch: 'master', credentialsId: 'GitHub-Credentials', url: 'https://github.com/starlightng/boa-web-app'
}
stage('2.BuildArtifact'){
sh "${mavenHome}/bin/mvn clean package"
}
stage('3.CodeQualityAnalysis'){
sh "${mavenHome}/bin/mvn sonar:sonar"
}
stage('4.UploadArtifacts'){
sh "${mavenHome}/bin/mvn deploy"
}
stage('5.Deploy2Dev'){
deploy adapters: [tomcat9(credentialsId: 'tomcat-Credentials', path: '', url: 'http://13.245.209.110:8080/')], contextPath: null, war: 'target/*war'
}
stage('6.Deploy2UAT'){
sshagent(['SAgent']) {
sh "scp -o StrictHostKeyChecking=no target/*war ec2-user@13.245.209.110:/opt/tomcat9/webapps/autapp.war"
}
}
stage('7.approval'){
timeout(time:8, unit:'HOURS'){
input message: 'Kindly approve deployment to Production'
}
}
stage('8.Deploy2Prod'){
sshagent(['SAgent']) {
sh "scp -o StrictHostKeyChecking=no target/*war ec2-user@13.245.209.110:/opt/tomcat9/webapps/app.war"
}
}
stage('7.EmailAlerts'){
emailext body: '''Hello,
Build status for on-going boa-app
Regards,
Starlight Communications''', subject: 'Project Status', to: 'isimichael@hotmail.com'
}
}