Does Jenkins provide a variable when replay is ran? If so what is that? I see in the log that is writes Replayed
but I am not looking to scrape the console output.
Asked
Active
Viewed 558 times
2

Laser Hawk
- 1,988
- 2
- 23
- 29
1 Answers
3
You can use 'cause' of which has triggered the job, in rawBuild.
def replayClassName = "org.jenkinsci.plugins.workflow.cps.replay.ReplayCause"
def isReplay = currentBuild.rawBuild.getCauses().any{ cause -> cause.toString().contains(replayClassName) }
*refered from
How to know inside jenkinsfile / script that current build is a replay?

Jiho
- 338
- 1
- 6
- 14