File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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' ) {
78 stage ' Only on master'
89 println ' This happens only on master'
910} else {
1011 stage ' Other branches'
1112 println " Current branch ${ env.BRANCH_NAME} "
1213}
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+ }
1327
You can’t perform that action at this time.
0 commit comments