File tree 1 file changed +20
-6
lines changed
1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change 1
- stage ' Init'
2
- node {
3
- checkout scm
4
- sh ' echo $BRANCH_NAME'
5
- }
6
- if (env. BRANCH_NAME == ' master ' ) {
1
+
2
+ #! groovy
3
+ node{
4
+ stage(' Source' ){
5
+ git ' https://github.com/devopstrainingblr/Ant-JavaProject.git'
6
+
7
+ if (env. BRANCH_NAME == ' master' ) {
7
8
stage ' Only on master'
8
9
println ' This happens only on master'
9
10
} else {
10
11
stage ' Other branches'
11
12
println " Current branch ${ env.BRANCH_NAME} "
12
13
}
14
+ }
15
+
16
+ stage(' Build' ){
17
+ /* bat "ant -f build-mt.xml" */ /* For windows machines*/
18
+ sh " ant -f build-mt.xml"
19
+ }
20
+ stage(' Send Email' ){
21
+ mail
bcc :
' [email protected] ' ,
body :
' Buils is done' ,
cc :
' ' ,
from :
' ' ,
replyTo :
' ' ,
subject :
' Build Status' ,
to :
' [email protected] '
22
+ }
23
+ /* stage('Archive'){
24
+ archiveArtifacts '/Users/bhaskarreddyl/.jenkins/workspace/Pipeline-Project-Ant-Web/dist/SampleAntProject.war'
25
+ }*/
26
+ }
13
27
You can’t perform that action at this time.
0 commit comments