1

Sometimes when we have deployed a build to release environment, it has come back with errors from the users and we need to rollback asap to previous build. We have testers who test our new changes on a QA release then when they are satisfied we push the code to master branch and then kick off a deploy in Jenkins to our release environment (jenkins pulls from the master branch). We tag the release in bitbucket when jenkins has finished the deployment (jenkins actually does this). Now if we have a new release of say tag 1.55 and we need to roll back to tag 1.50, is it possible to do this via jenkins or how is this done?

Thanks in advance.

Steve Green
  • 79
  • 1
  • 10
  • If I were you I'd have multiple jobs that are responsible for specific tasks, one CI job that builds and tag the branch, then another job to deploy to whichever environment from a given tag. Then you can daisy-chain the two for the current scenario and use the second part to deploy a fixed tag when you want to rollback. This I'd say the simplest implementation of this. You can have feedback-driven multi-branch pipelines that can link to other systems for testing and things like Slack for user approval before deployment. It all depends on how much you want to ticker and invest in Jenkins jobs. – Prav Jan 04 '21 at 19:21
  • Thanks for that, unfortunately I'm pretty basic when it comes to Jenkins pipelines etc, but what you say makes good sense. We do have jenkins pipelines which accept parameters such as which environment to build to etc and also have some multbranch ones - but I didn't set these up and the person who did has left the company. Guess I need do some study on Jenkins more. – Steve Green Jan 04 '21 at 19:42
  • Jenkins is pretty easy to understand and this is a good place for a start [Pipeline Syntax](https://www.jenkins.io/doc/book/pipeline/syntax) – Prav Jan 04 '21 at 19:47
  • The simplest way would be to make a branch from the tag, then adjust your job to build using that branch. See [branch from tag](https://stackoverflow.com/a/10940996/598141). Also, disagree w/@Praveen's strategy. – Ian W Jan 05 '21 at 08:30

0 Answers0