-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile_boa
46 lines (40 loc) · 1.38 KB
/
Jenkinsfile_boa
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
node{
def mavenHome = tool name: 'maven3.8.4'
stage('1.Clone'){
git branch: 'master', credentialsId: 'Git_Credentials', url: 'https://github.com/LandmakTechnology/paypal-web-app'
}
stage('2.MavenBuild'){
sh "${mavenHome}/bin/mvn clean package"
// bat 'mvn package'
}
stage('3.CodeQuality'){
sh "${mavenHome}/bin/mvn sonar:sonar"
}
stage('4.UploadArtifacts'){
sh "${mavenHome}/bin/mvn deploy"
}
stage('6.Deploy2dev'){
deploy adapters: [tomcat9(credentialsId: 'Tomcat_Credentials', path: '', url: 'http://18.207.210.70:8080/')], contextPath: null, war: 'target/web-app.war'
}
stage('5.Deploy2uat'){
sshagent(['agentcredentials']) {
sh "scp -o StrictHostKeyChecking=no target/*.war [email protected]:/opt/tomcat9/webapps/uat.war"
}
}
stage('7.approval'){
timeout(time:8, unit:'HOURS'){
input message: 'Please approve deployment to Production'
}
}
stage('8.Deploy2prod'){
sshagent(['agentcredentials']) {
sh "scp -o StrictHostKeyChecking=no target/*.war [email protected]:/opt/tomcat9/webapps/app.war"
}
}
stage('9.EmailAlerts'){
emailext body: '''Hi
Build status for boa app.
Regards,
Landmark Technologies''', recipientProviders: [developers(), requestor()], subject: 'Project status', to: '[email protected]'
}
}