i am using while loop inside jenkins stage, below is the code. Issue is with elif [ $siteStatus = "SUCCEEDED" ] statement. once this statement is true i want this step to be completed and go to next step. which is not happening, it again going into loop.
while(currtime < futtime){
date = new Date()
currtime = date.getTime()
sleep(5);
sh """
export siteStatus= SUCCEEDED
if [ \$siteStatus = "IN_PROGRESS" ]
then
continue
elif [ \$siteStatus = "SUCCEEDED" ]
then
exit 0
else
exit 1
fi