Created
October 8, 2020 19:49
-
-
Save jovemfelix/8a3f1389b11d5d0fa536f5bc42b212f7 to your computer and use it in GitHub Desktop.
jenkins echo with stage variable if defined
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
def echos(def s ){ | |
def stage = "[${env.STAGE_NAME}]" | |
if (stage == "[null]") { | |
stage = "" | |
} | |
println "${stage}${s}" | |
} | |
def call(def s) { | |
return echos(s) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment