运行重播时 Jenkins 是否提供变量?如果是的话那是什么?我在日志中看到写入 Replayed
但我不想抓取控制台输出。
最佳答案
您可以在 rawBuild 中使用触发作业的“原因”。
def replayClassName = "org.jenkinsci.plugins.workflow.cps.replay.ReplayCause"
def isReplay = currentBuild.rawBuild.getCauses().any{ cause -> cause.toString().contains(replayClassName) }
*引用自
How to know inside jenkinsfile / script that current build is a replay?
关于jenkins - 是否有用于 Replay 的 Jenkins 环境变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58228987/