forked from sunildevops77/maven
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DeclarativePipeline_Jenkinsfile
52 lines (48 loc) · 1.31 KB
/
DeclarativePipeline_Jenkinsfile
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
pipeline
{
agent any
stages
{
stage('ContDownload')
{
steps
{
git 'https://github.com/selenium-saikrishna/maven.git'
}
}
stage('ContBuild')
{
steps
{
sh 'mvn package'
}
}
stage('ContDeployment')
{
steps
{
sh 'scp /var/lib/jenkins/workspace/Declarative_Pipeline/webapp/target/webapp.war vagrant@10.10.10.32:/var/lib/tomcat7/webapps/qaenv.war'
}
}
stage('ContTesting')
{
steps
{
git 'https://github.com/selenium-saikrishna/TestingOnLinux.git'
sh 'java -jar /var/lib/jenkins/workspace/Declarative_Pipeline/testing.jar'
}
}
}
post
{
success
{
input message: 'Waiting for approval from DM', submitter: 'Srinivas'
sh 'scp /var/lib/jenkins/workspace/Declarative_Pipeline/webapp/target/webapp.war vagrant@10.10.10.33:/var/lib/tomcat7/webapps/prodenv.war'
}
failure
{
mail bcc: '', body: '', cc: '', from: '', replyTo: '', subject: 'Build failed', to: 'gandham.saikrishna@gmail.com'
}
}
}