Hi All,
I am trying to change the value of string dependign upon the unittest cases
passed by reading a file.
For next stage to proceed I want to set the string depending upon the value
next stage qa or other stage can proceed.
but not able to change value f string in jenkins file.
value of res is not changing at all
also to verify I have added one more script block belwo it to verify if
able to read file proerly and its value, its working fine. below its
printing failure as value is set to 1 in result file.
not sure on this, please let me know possible solution thanks in advance
=====================
environment {
res = 'pass'
qapass = 'fail'
output = '-1'
}
....
....
script {
output = readFile 'result'
echo "Value of output is $output"
echo 'inside the script'
sh '''
awk '{ if ($1 == 0 ) { $res = "passed" }
else $res = "fail" }' result
echo 'outside the script'
echo "value is $res"
'''
}
script {
sh '''
awk '{ if ($1 == 0 ) { print "Success"; }
else print "failure" }' result
echo 'outside the script'
'''
}
==========================
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/8b5e5fd5-8e6f-486f-aa54-f5bc97aa1f03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.