Skip to content

Commit

Permalink
Update Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiyaadQasem authored Jan 16, 2021
1 parent d97dec5 commit 7eeb8ad
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions demo/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,7 @@ node ('Slave'){
}


stage ('tag'){
sh '''
version=\$(git describe — tags `git rev-list — tags — max-count=1`)
#Version to get the latest tag
A=”\$(echo \$version|cut -d '.' -f1)”
B=”\$(echo \$version|cut -d '.' -f2)”
C=”\$(echo \$version|cut -d '.' -f3)”
if [ \$C -gt 8 ]
then
if [ \$B -gt 8 ]
then
A=\$((A+1))
B=0 C=0
else
B=\$((B+1))
C=0
fi
else
C=\$((C+1))
fi
echo "A[\$A.\$B.\$C]">outFile """
nextVersion = readFile 'outFile'
echo "we will tag '${nextVersion}'"
result =nextVersion.substring(nextVersion.indexOf("[")+1,nextVersion.indexOf("]");
echo "we will tag '${result}' " '''
}


stage("test-build"){
sh "mvn clean install -f ./demo/pom.xml"
}
Expand Down

0 comments on commit 7eeb8ad

Please sign in to comment.