【发布时间】:2019-07-22 17:39:49
【问题描述】:
我需要提取jenkinsfile参数的前3个字符:
string(name: 'DB_Type', defaultValue: 'mysql' )
我尝试了以下方法,但没有成功:
prefix=${params.db_type}
prefix=prefix.substring(0,2)
【问题讨论】:
-
你有一个错字:
params.db_type而不是params.DB_Type。 -
@Matt Schuchard 抱歉打错了,我用 DB_Type 试过了,它不起作用。
-
描述“没用”...异常?空字符串?
标签: groovy jenkins-pipeline jenkins-pipeline-unit