7

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}";
Andrej Istomin
  • 2,527
  • 2
  • 15
  • 22

1 Answers1

0

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.

Ian Pilipski
  • 507
  • 3
  • 8