forked from faudeltn/Jenkins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pipeline-Git-Maven
44 lines (36 loc) · 1.48 KB
/
Pipeline-Git-Maven
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('master') {
stage('SCM Checkout'){
git 'https://github.com/sivajavatechie/JenkinsWar'
}
stage('Compile-Package'){
def mvn_version = 'Maven'
withEnv( ["PATH+MAVEN=${tool mvn_version}/bin"] ) {
sh "mvn clean package"
}
}
stage('Email Notification'){
mail bcc: '', body: '''Hi Welcome to jenkins email alerts
Thanks
Lotfi''', cc: '', from: '', replyTo: '', subject: 'Jenkins Job', to: 'lotfi@yallalabs.local'
}
}
#############################################################################################################
node('master') {
stage('SCM Checkout'){
git 'https://github.com/sivajavatechie/JenkinsWar'
}
stage('Compile-Package'){
def mvnHome = tool name: 'Maven', type: 'maven'
sh "${mvnHome}/bin/mvn clean package"
}
stage('Deploy Tomcat'){
sh 'curl --upload-file target/*.war "http://admin:password@192.168.1.203:8080/manager/text/deploy?path=/app&update=true"'
// sh "curl -v -u user:password -T target/*.war http://192.168.1.203:8080/manager/text/deploy?path=&update=true
//sh "curl -u depuser:admin --upload-file target/*.war http://192.168.1.203:8080/manager/text/deploy?path=/JenkinsWar&update=true"
}
stage('Email Notification'){
mail bcc: '', body: '''Hi Welcome to jenkins email alerts
Thanks
Lotfi''', cc: '', from: '', replyTo: '', subject: 'Jenkins Job', to: 'lotfi@yallalabs.local'
}
}