Mukesh
Mukesh

Reputation: 7778

Is there any way to revert the current build in 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?

Upvotes: 7

Views: 20733

Answers (3)

Swapnil Patil
Swapnil Patil

Reputation: 1

All you can do is you should revert your git changes to previous commit and rebuild.

Upvotes: -1

Balmipour
Balmipour

Reputation: 3055

(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

Upvotes: 5

dimaj
dimaj

Reputation: 3

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.

Upvotes: -1

Related Questions