While writing pipelines in Jenkins using Groovy, we can interchangeably use echo and println statements. Is there any difference between these statements?
For example,
buildNumber = "1.10";
echo "BUILD #${buildNumber}";
println "BUILD #${buildNumber}";
There may be a slight difference, as echo is a step where println is groovy. The echo step may actually make a step reference on the output view of Jenkins step view and blue ocean steps. The println may just output a log without creating those extra visual step references in the UI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With