Skip to content

Commit 4418ace

Browse files
committed
Jenkinsfile Updated with more Syntax
1 parent 0cd034e commit 4418ace

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Jenkinsfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,38 @@
11
pipeline {
22
agent any
3+
environment {
4+
NEW_VERSION = env.GIT_COMMIT
5+
}
36
stages {
47
stage("build"){
58
steps {
69
echo 'Building the application'
10+
echo "Building version ${NEW_VERSION}"
711
}
812
}
913
stage("test") {
14+
when {
15+
expression {
16+
env.BRANCH_NAME == 'dev' || env.BRANCH_NAME != 'master'
17+
}
1018
steps {
1119
echo 'Testing the application'
20+
echo "Testing version ${NEW_VERSION}"
1221
}
1322
}
1423
stage("deploy"){
1524
steps {
1625
echo 'Deploying the application'
26+
echo "Deploying version ${NEW_VERSION}"
1727
}
1828
}
1929
}
30+
post {
31+
always{
32+
echo 'Build Succeeded'
33+
}
34+
success {
35+
echo 'Build Succeeded for this App'
36+
}
37+
}
2038
}

0 commit comments

Comments
 (0)