-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkins
More file actions
36 lines (33 loc) · 819 Bytes
/
Jenkins
File metadata and controls
36 lines (33 loc) · 819 Bytes
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
node
{
def mavenHome= tool name: "maven3.6.3"
stage('CheckOutCode')
{
git branch: 'development', credentialsId: '59b29e0a-0084-4ef5-b135-6230a9f6ab6c', url: 'https://github.com/tejkumaraws/maven-web-application.git'
}
stage('Build')
{
sh "${mavenHome}/bin/mvn clean package"
}
stage('ExecuteSonarQube')
{
sh "${mavenHome}/bin/mvn sonar:sonar"
}
stage('UploadArtificartIntoNexus')
{
sh "${mavenHome}/bin/mvn deploy"
}
stage('DeployApplicationTOmcat')
{
sshagent(['08d3184c-dce4-430d-a658-ca411cbc462b'])
{
sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war [email protected]:/opt/apache-tomcat-9.0.31/webapps/"
}
}
stage('SendEmail')
{
emailext body: '''Build is over
Regards,
Tej.''', subject: 'Build is Successful', to: '[email protected]'
}
}