forked from RAHAMSHAIK007/maven-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-oldaug16
61 lines (46 loc) · 1.69 KB
/
Jenkinsfile-oldaug16
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
node('flipkart-node')
{
//http://localhost:8080/pipeline-syntax/globals#currentBuild
//Getting the env global varibale values
echo "GitHub BranhName ${env.BRANCH_NAME}"
echo "Jenkins Job Number ${env.BUILD_NUMBER}"
echo "Jenkins Node Name ${env.NODE_NAME}"
echo "Jenkins Home ${env.JENKINS_HOME}"
echo "Jenkins URL ${env.JENKINS_URL}"
echo "JOB Name ${env.JOB_NAME}"
def MavenHome = tool name: 'Maven3.6.1', type:'maven'
properties([
buildDiscarder(logRotator(numToKeepStr: '3')),
pipelineTriggers([
pollSCM('* * * * *')
])
])
/*
stage('CheckoutCode'){
git branch: 'development', credentialsId: '2587140f-2970-4f0e-aac3-62624e3d9682', url: 'https://github.com/MithunTechnologiesDevOps/maven-web-application.git'
}
stage('Build')
{
sh "${MavenHome}/bin/mvn clean package"
}
stage('ExecuteSonarQubeReport'){
sh "${MavenHome}/bin/mvn sonar:sonar"
}
stage('UploadArtifact'){
sh "${MavenHome}/bin/mvn deploy"
}
stage('DeployApplication'){
sshagent(['e5a7a729-2e31-4d89-9b43-b3154cf128de']) {
sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war [email protected]:/opt/apache-tomcat-9.0.22/webapps/maven-web-application.war"
}
}
*/
stage('EmailNotification'){
emailext body: '''Build is over
Please check the logs...
Regards,
Mithun Software Solutions,
Bangalore.
''', subject: 'Build done', to: '[email protected]'
}
}