In Jenkins pipeline, what's the difference between:
sh """
...
...
...
"""
and
sh '''
...
...
...
'''
Thanks in advance
On Linux, BSD, and Mac OS (Unix-like) systems, the sh step is used to execute a shell command in a Pipeline.
Declarative pipelines break down stages into individual stages that can contain multiple steps. Scripted pipelines use Groovy code and references to the Jenkins pipeline DSL within the stage elements without the need for steps.
A node is a machine which is part of the Jenkins environment and is capable of executing a Pipeline. Also, a node block is a key part of Scripted Pipeline syntax.
Both are multi-line strings
The first multi-line string with """
can be templated into a GroovyString
The second one with '''
cannot (and is just a java String with newlines)
I have linked to the relevant documentation
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