我正在使用可在 Jenkins 中运行的 Groovy 脚本。我想知道如何让每次运行的循环增加 10000
。
假设第一天的值为 10000
,第二天为 20000
,接下来的第二天为 30000
、40000
和依此类推,直到接下来的 10 天。
如果我使用随机数来做这件事有点困难,当 Jenkins 工作完成时很难检索到随机数。
最佳答案
您可以按以下方式操作
int startFrom = 0
int limitValue = 100000
int incrementBy = 10000
startFrom.step limitValue, incrementBy, {
println it
}
关于jenkins - 在 groovy 中以 10000 递增循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48698123/