Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between echo and println in Jenkinsfile

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}";
like image 714
Alonso Karlos Avatar asked May 02 '26 06:05

Alonso Karlos


1 Answers

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.

like image 175
Ian Pilipski Avatar answered May 05 '26 10:05

Ian Pilipski



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!