How to promote a build when identical build name and numbers exist

喜你入骨 提交于 2020-12-15 06:58:29

问题


The Artifactory REST API has a resource for build promotion, which takes a build name and build number. One of my projects has been posting three builds with identical build names and build numbers. When viewing the projects in the repo they are sufficiently distinct:

  • Myproject
  • Myproject-foo
  • Myproject-no-bar

I am looking to promote just one of these (Myproject-foo). I can get the build runs for the build name, but as the URIs are matching there is no way to examine the different builds further. Is there anything I can do to automate the promotion of a specific project from each of these build numbers, or is manually clicking through, examining each one and promoting the appropriate images the only way?


回答1:


Although it's possible to end up with the same build name and build number, you should avoid this situation because it makes it harder to distinguish between runs in UI and REST API. From what I can see in that case the promotion REST API will promote the latest build run (not all of them).

If you still want to do that, you can check out this plugin https://github.com/jfrog/artifactory-user-plugins/tree/master/build/promoteWithDeps (which has a wider scope but it accepts an additional parameter buildStartTime to distinguish between build runs)




回答2:


You shouldn't be able to publish three builds with the same build.name and build.number. Artifactory will normally throw a 500 error if this is attempted. Check the artifactory.log to see if all three builds are actually making it into the server.



来源:https://stackoverflow.com/questions/52200916/how-to-promote-a-build-when-identical-build-name-and-numbers-exist

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!