非常欢迎您解决有关此问题的任何建议!:)
下载最新的版本效果很好,但是该对象不包含任何属性。是否可以从下载的版本中获取属性?
固执己见的做法是获得一个带有预定义值的输入框,以显示先前的版本,即“ R1G”,并为用户提供将值编辑为R2A或任何其他值的选项,或者仅中止操作(中止表示将没有版本)。用户还可以选择不执行任何操作,这将导致超时并最终终止。
我想要
'''一些代码
echo 'Publiching Artifact.....'
script{
def artifactory_server_down=Artifactory.server 'Artifactory'
def downLoad = """{
"files":
[
{
"pattern": "reponame/",
"target": "${WORKSPACE}/prev/",
"recursive": "false",
"flat" : "false"
}
]
}"""
def buildInfodown=artifactory_server_down.download(downLoad)
//Dont need to publish because I only need the properties
//Grab the latest revision name here and use it again
echo 'Retriving revision from last uploaded build.....'
env.LAST_BUILD_NAME=buildInfodown.build.number
//Yes its a map and I have tried with ['build.number'] but the map is empty
}
echo "Previous build name is $env.LAST_BUILD_NAME" //Will not contain the old (latest)
'''片段结尾
输出为null或我给定的默认值var,而不是预期的版本号。
是的,首先,这些属性应该存在于您要下载的工件中。
build.number等是工件的buildinfo.json文件的一部分。这些不是属性,而是某种元数据。该信息将在工件中的“构建”菜单下可见。选择仓库和内部版本号。
在最后一列/选项卡上将有buildinfo。单击该文件-该文件将保存您需要的与工件相对应的所有信息。
CI将把build.number和其他信息推送/上载到工件。
例如,在Jenkins的情况下,尝试推送至工件“捕获并发布构建信息”时有一个可用选项->此步骤完成了工作
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句