forked from Hosanna-Business-Connections-Inc/mawen-web-app
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Jenkinsfile2
44 lines (36 loc) · 1.11 KB
/
Jenkinsfile2
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
node
{
def mavenHome = tool name: "maven3.6.3"
stage("1. git clone")
{
git credentialsId: 'gitCredentials', url: 'https://github.com/LandmakTechnology/maven-web-app.git'
}
stage("2. Build")
{
sh "${mavenHome}/bin/mvn clean package"
// bat mvn clean package - for winows OS
}
stage('3. Sonar')
{
//sh "${mavenHome}/bin/mvn sonar:sonar"
}
stage('4. Nexus')
{
//sh "${mavenHome}/bin/mvn deploy"
}
stage('5. Deploy')
{
sshagent(['TomcatServer4']) {
}
// echo "Can I deploy to production"
deploy adapters: [tomcat9(credentialsId: 'tomcatCredentials', path: '', url: 'http://34.204.166.28:8080/')], contextPath: null, war: '**/maven-web-app.war'
//sh "sudo scp -o StrictHostKeyChecking=no target/maven-web-app.war [email protected]:/opt/apache-tomcat-9.0.37/webapps/"
}
stage('6. Email Notification')
{
emailext body: '''Hi
Build Status
Landmark Technology
+ 1 437 215 2483''', recipientProviders: [developers()], subject: 'Build status', to: '[email protected]'
}
}