Skip to content

Commit 2e25ede

Browse files
Create Jenkinsfile
1 parent f20c936 commit 2e25ede

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

Jenkinsfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
node{
2+
def mavenHome = tool name: "maven3.8.4"
3+
4+
properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: '5')), [$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false], [$class: 'JobLocalConfiguration', changeReasonComment: ''], pipelineTriggers([pollSCM('* * * * *')])])
5+
6+
stage('CheckoutCode'){
7+
8+
git branch: 'development', credentialsId: '69c370d6-30e9-4ad2-b97d-2b3a76398aeb', url: 'https://github.com/MithunTechnologiesDevOps/maven-web-application.git'
9+
}
10+
11+
stage('Build'){
12+
sh "${mavenHome}/bin/mvn clean package"
13+
}
14+
15+
/*
16+
stage('ExecuteSonarQubeReport'){
17+
sh "${mavenHome}/bin/mvn sonar:sonar"
18+
}
19+
20+
stage('UploadArtifactsIntoNexus'){
21+
sh "${mavenHome}/bin/mvn deploy"
22+
}
23+
24+
stage('DeployAppintoTomcatServer'){
25+
26+
sshagent(['4f0deabf-417d-42cb-b0e4-62e8bbae226c']) {
27+
sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war [email protected]:/opt/apache-tomcat-9.0.54/webapps/"
28+
}
29+
}
30+
31+
stage('SendEmailNotification'){
32+
33+
emailext body: '''Build Over..
34+
35+
Regards,
36+
Mithun Technologies,
37+
9980923226''', subject: 'Build Over', to: '[email protected]'
38+
}
39+
*/
40+
41+
}

0 commit comments

Comments
 (0)