Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to revert the current build in Jenkins?

Tags:

git

jenkins

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

Is there any way possible to revert back the build and to see what were the files deployed in the current build?

like image 475
Mukesh Avatar asked Jul 02 '15 14:07

Mukesh


1 Answers

(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/trunk would become http://mysvn.com/myproject/trunk@42

While this easy method was enough for me, if you frequently revert builds, adding a parameter to 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

like image 63
Balmipour Avatar answered Sep 21 '22 18:09

Balmipour