Skip to content

Instantly share code, notes, and snippets.

@jovemfelix
Created October 8, 2020 19:49
Show Gist options
  • Save jovemfelix/8a3f1389b11d5d0fa536f5bc42b212f7 to your computer and use it in GitHub Desktop.
Save jovemfelix/8a3f1389b11d5d0fa536f5bc42b212f7 to your computer and use it in GitHub Desktop.
jenkins echo with stage variable if defined
#!/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