-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-war-to-tomcat
30 lines (28 loc) · 938 Bytes
/
deploy-war-to-tomcat
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
node{
stage('SCM Checkout'){
git 'https://github.com/javahometech/my-app'
}
stage('Compile-Package'){
// Get maven home path
def mvnHome = tool name: 'maven-3', type: 'maven'
sh "${mvnHome}/bin/mvn package"
}
stage('Deploy to Tomcat'){
sshagent(['tomcat-dev']) {
sh 'scp -o StrictHostKeyChecking=no target/*.war [email protected]:/opt/tomcat8/webapps/'
}
}
stage('Email Notification'){
mail bcc: '', body: '''Hi Welcome to jenkins email alerts
Thanks
Hari''', cc: '', from: '', replyTo: '', subject: 'Jenkins Job', to: '[email protected]'
}
stage('Slack Notification'){
slackSend baseUrl: 'https://hooks.slack.com/services/',
channel: '#jenkins-pipeline-demo',
color: 'good',
message: 'Welcome to Jenkins, Slack!',
teamDomain: 'javahomecloud',
tokenCredentialId: 'slack-demo'
}
}