git 有什么办法可以恢复 Jenkins 中的当前构建吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31187826/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there any way to revert the current build in Jenkins?
提问by Mukesh
My newly created deployment team is struggling to find a way to revert a currently deployed build. They have integrated Jenkins with Git and Bitbucket
我新创建的部署团队正在努力寻找一种方法来恢复当前部署的构建。他们将 Jenkins 与 Git 和 Bitbucket 集成
Is there any way possible to revert back the build and to see what were the files deployed in the current build?
有什么办法可以恢复构建并查看当前构建中部署的文件是什么?
回答by Balmipour
(can't comment yet, so I answer)
(还不能评论,所以我回答)
If I understand correctly, all you need is to build a previous version of your project, right ?
如果我理解正确,您所需要的只是构建项目的先前版本,对吗?
There is indeed (multiple) ways to do this. I don't know GIT, but guess it's not that different from SVN. With SVN, in the build configuration, you can add @xxx after the repository's URL to build a precise revision. For example, to get revision 42, http://mysvn.com/myproject/trunkwould become http://mysvn.com/myproject/trunk@42
确实有(多种)方法可以做到这一点。我不知道 GIT,但我猜它与 SVN 没有什么不同。使用 SVN,在构建配置中,您可以在存储库的 URL 后添加 @xxx 以构建精确的修订。例如,要获得修订版 42,http://mysvn.com/myproject/trunk将变为http://mysvn.com/myproject/trunk@42
While this easy method was enough for me, if you frequently revert builds, adding a parameterto your build will be a better option. I don't remember the exact syntax and lack of time right now, but you should google it easily if you need it.
虽然这个简单的方法对我来说已经足够了,但如果你经常恢复构建,那么在你的构建中添加一个参数将是一个更好的选择。我现在不记得确切的语法和缺乏时间,但如果你需要它,你应该很容易地谷歌它。
See this O'reilly book chapter for more informations : https://books.google.fr/books?id=4bjDCQAAQBAJ&pg=PA328&lpg=PA328&dq=jenkins+revert+to+previous+version&source=bl&ots=FQgnttOu_Q&sig=eC9ndNxmm4lhdu4RuRgLZMHpEMU&hl=fr&sa=X&ved=0CG0Q6AEwCWoVChMI2-bD3JDqxwIVAj8aCh25UAsQ#v=onepage&q=jenkins%20revert%20to%20previous%20version&f=false
有关更多信息,请参阅 O'reilly 图书章节:https://books.google.fr/books?id=4bjDCQAAQBAJ&pg=PA328&lpg=PA328&dq=jenkins+revert+to+previous+version&source=bl&ots=FQgnttOu_Q&sigmmeChphl&SigZMhEhdR&SigZMhEhd&SigZ&Ehpg=PA328&lpg=PA328&dq=jenkins+revert+to+previous+version =0CG0Q6AEwCWoVChMI2-bD3JDqxwIVAj8aCh25UAsQ#v=onepage&q=jenkins%20revert%20to%20previous%20version&f=false
回答by Swapnil Patil
All you can do is you should revert your git changes to previous commit and rebuild.
您所能做的就是将您的 git 更改恢复到之前的提交和重建。
回答by dimaj
If I understand your question correctly, all you'll need to do is check git history for the given project and it'll tell you what was changed. Also, Jenkins should have link on the left sidebar called changes
. Click on that and it'll tell you exactly what was changed for the current build.
如果我正确理解您的问题,您需要做的就是检查给定项目的 git 历史记录,它会告诉您发生了什么变化。此外,Jenkins 应该在左侧边栏上有一个名为changes
. 单击它,它会准确地告诉您当前构建的更改内容。