Skip to content

Commit bb4e807

Browse files
Update Jenkinsfile
1 parent 6f54568 commit bb4e807

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

Jenkinsfile

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
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

0 commit comments

Comments
 (0)