forked from MaheshBangaru/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-bakcupmarch15
61 lines (50 loc) · 1.7 KB
/
Jenkinsfile-bakcupmarch15
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!groovy
properties([
buildDiscarder(logRotator(numToKeepStr: '1')),
pipelineTriggers([
pollSCM('* * * * *')
])
])
node{
stage('CheckOutCode'){
git branch: 'development', credentialsId: 'e36e58e1-2845-4868-92b2-aae7fcf88927', url: 'https://github.com/MithunTechnologiesDevOps/maven-web-application.git'
}
stage('Build'){
if(isUnix()){
sh 'mvn clean package'
}else{
bat 'mvn clean package'
}
}
/*
stage('SonarQubeReport'){
if(isUnix()){
sh 'mvn sonar:sonar'
}else{
bat 'mvn sonar:sonar'
}
}
stage('UploadintoNexus'){
if(isUnix()){
sh 'mvn deploy'
}else{
bat 'mvn deploy'
}
}
stage('DeployAppIntoTomcat'){
sh 'echo App is deploying into tomcat server'
sh 'cp $WORKSPACE/target/maven-web-application.war /Users/mithunreddy/MithunTechnologies/Softwares/Running/apache-tomcat-9.0.14/webapps/'
sh 'echo Deployed the into Tomcat successsfully'
}
*/
stage('SendEmailNotification'){
mail bcc: '[email protected]', body: '''Build Done.
Regards,
Mithun Technologies,
9980923226.
''', cc: '[email protected]', from: '[email protected]', replyTo: '[email protected]', subject: 'Duild done', to: '[email protected]'
}
stage('SendSlackNotifications'){
slackSend baseUrl: 'https://devops-team-bangalore.slack.com/services/hooks/jenkins-ci/', channel: 'build-notification', color: 'black', message: 'Build sent to Slack', tokenCredentialId: '9558055f-b9e7-485a-a61c-898e24fa0678'
}
}